feat: add constants/float16/inv-pi#8931
feat: add constants/float16/inv-pi#8931Amansingh0807 wants to merge 2 commits intostdlib-js:developfrom
constants/float16/inv-pi#8931Conversation
Add half-precision floating-point constant for 1/π (inverse of pi). The constant value 0.31835937 is the closest half-precision floating-point representation of the mathematical constant 1/π. This addresses the missing float16 inverse constants noted in issue stdlib-js#8920 and complements the recently added float16 pi constant from PR stdlib-js#8919. Implementation follows stdlib conventions: - Package structure matches existing float16 constants - Includes comprehensive documentation and examples - Provides TypeScript definitions - Includes test suite for validation - Adds REPL documentation
Coverage Report
The above coverage report was generated for the changes in this PR. |
|
Hi @Neerajpathak07, |
|
It's better to hold those for a while till we can get the PR's on |
|
One thing that's on top of my mind is that whether this package is necessary and if so which packages would we be needing this constant for. |
|
Thanks for the clarification, @Neerajpathak07! Regarding the usefulness of 1/π appears quite frequently in numerical code, especially in :
Having a dedicated constant avoids repeated divisions, ensures consistent rounding across precisions, and keeps the API parallel to existing constants like But yes, I am happy to wait until the |
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
task: lint_filenames status: passed
task: lint_editorconfig status: passed
task: lint_markdown status: passed
task: lint_package_json status: passed
task: lint_repl_help status: passed
task: lint_javascript_src status: passed
task: lint_javascript_cli status: na
task: lint_javascript_examples status: passed
task: lint_javascript_tests status: passed
task: lint_javascript_benchmarks status: na
task: lint_python status: na
task: lint_r status: na
task: lint_c_src status: na
task: lint_c_examples status: na
task: lint_c_benchmarks status: na
task: lint_c_tests_fixtures status: na
task: lint_shell status: na
task: lint_typescript_declarations status: passed
task: lint_typescript_tests status: passed
task: lint_license_headers status: passed ---
Resolves #{{TODO: add issue number}}.
Description
This pull request:
constants/float16/inv-piRelated Issues
This pull request has the following related issues:
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
@stdlib-js/reviewers