Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(stdlib): Reimplement Number.gamma and Number.factorial #2182

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

spotandjake
Copy link
Member

@spotandjake spotandjake commented Oct 25, 2024

This pr re-implements Number.gamma and Number.factorial.

This pr is blocked on #2181 as the tests will fail due to the precision issue when computing sin(pi * z) / gamma(1 - z)

I think we should also open an issue to port the c version here in the future as this approximation provides decent accuracy but we accumulate some extra error due to the error in other approximation functions such as sin, this should also make things a little faster.

This pr closes: #1478

@ospencer
Copy link
Member

Looks like the tests are failing.

@spotandjake
Copy link
Member Author

Looks like the tests are failing.

We need to wait for #2181 to be merged.

@spotandjake
Copy link
Member Author

spotandjake commented Oct 27, 2024

Looks like the tests are failing.

tests on this are now passing and its ready for review

stdlib/number.gr Outdated Show resolved Hide resolved
stdlib/number.gr Outdated Show resolved Hide resolved
stdlib/number.gr Show resolved Hide resolved
stdlib/number.gr Show resolved Hide resolved
@ospencer ospencer added this pull request to the merge queue Nov 7, 2024
Merged via the queue into grain-lang:main with commit 1e5f921 Nov 7, 2024
12 checks passed
@github-actions github-actions bot mentioned this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stdlib: Reintroduce gamma, factorial functions
2 participants