Conversation

AadishJ

Resolves #3448.

Description

What is the purpose of this pull request?

This pull request:

  • Adds a C implementation of the binomial cumulative distribution function (CDF).
  • Includes benchmarks for the C implementation.
  • Provides examples demonstrating the usage of the binomial CDF in C.

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@stdlib-botstdlib-bot added the Needs ReviewA pull request which needs code review.label Dec 13, 2024
@stdlib-bot

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot

Coverage Report

PackageStatementsBranchesFunctionsLines
math/base/napi/ternary$\color{green}155/155$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}155/155$
$\color{green}+100.00\%$
stats/base/dists/binomial/cdf$\color{green}327/327$
$\color{green}+100.00\%$
$\color{green}33/33$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}327/327$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@AadishJAadishJ closed this Dec 13, 2024
@AadishJAadishJ reopened this Dec 13, 2024
@AadishJAadishJ changed the title feat: add C implementation for binomial CDF feat: add C implementation for @stdlib/stats/base/dists/binomial/cdf Dec 14, 2024
@PlaneshifterPlaneshifter changed the title feat: add C implementation for @stdlib/stats/base/dists/binomial/cdf feat: add C implementation for @stdlib/stats/base/dists/binomial/cdf Dec 14, 2024
@PlaneshifterPlaneshifter changed the title feat: add C implementation for @stdlib/stats/base/dists/binomial/cdf feat: add C implementation for stats/base/dists/binomial/cdf Dec 15, 2024
@AadishJAadishJ marked this pull request as draft December 15, 2024 06:08
@stdlib-botstdlib-bot removed the Needs ReviewA pull request which needs code review.label Dec 15, 2024
@AadishJAadishJ marked this pull request as ready for review December 15, 2024 06:15
@stdlib-botstdlib-bot added theA pull request which needs code review.label Dec 15, 2024
@Neerajpathak07

@AadishJ adding include ternary.h file in your commit it is not necessary for this issue as you might have seen it reflects the code coverage for that file as well.
Same for the main.c file as well.

@AadishJ

Hey @Neerajpathak07 , I included the ternary as there was nothing made for a long long double previously so I made it for myself , is it incorrect and if so how should I do it correctly?

@Neerajpathak07

image
Once you remove these two files from your commit the unnecessary code coverage for ternary should also be removed.

@AadishJ

Hey, @Neerajpathak07 I totally understand what you are saying but there are some important changes in those files as I have created the long long double version in them which did not exist before so removing those files would break my code, please let me know if I am thinking wrong or is there another way to do this. Thanks.

@Neerajpathak07

@AadishJ Ok then,

return betainc( p, x + 1.0, n - x, true, true );
return stdlib_base_betainc( p, x + 1.0, n - x, true, true );

but also you will be requiring stdlib_base_betainc for main.c but there are No C implementations for betainc so this PR might have to wait until we have that merged.
Refer:- #3986

@AadishJ

That's completely fine. Thanks for the review

@Planeshifter

/stdlib update-copyright-years

@stdlib-botstdlib-bot added the bot: In ProgressPull request is currently awaiting automation.label Jun 18, 2025
@stdlib-botstdlib-bot added Good First PRA pull request resolving a Good First Issue.and removed bot: In ProgressPull request is currently awaiting automation.labels Jun 18, 2025
Sign up for free to join this conversation on . Already have an account? Sign in to comment
Good First PRA pull request resolving a Good First Issue.Needs ReviewA pull request which needs code review.
None yet

Successfully merging this pull request may close these issues.

[RFC]: Add C implementation for @stdlib/stats/base/dists/binomial/cdf