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: add constants/float32/pi-squared #6069

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

Neerajpathak07
Copy link
Contributor

@Neerajpathak07 Neerajpathak07 commented Mar 15, 2025

Progresses #649
Resolves #6070 .

Description

What is the purpose of this pull request?

This pull request:

  • adds constants/float32/pi-squared

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-bot
Copy link
Contributor

stdlib-bot commented Mar 15, 2025

Coverage Report

Package Statements Branches Functions Lines
constants/float32/pi-squared $\color{green}52/52$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}0/0$
$\color{green}+100.00\%$
$\color{green}52/52$
$\color{green}+100.00\%$

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

@Neerajpathak07 Neerajpathak07 marked this pull request as ready for review March 15, 2025 11:51
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 15, 2025
@Planeshifter Planeshifter added the Potential Duplicate There might be another pull request resolving the same issue. label Mar 15, 2025
@kgryte kgryte removed the Potential Duplicate There might be another pull request resolving the same issue. label Mar 16, 2025
@Neerajpathak07 Neerajpathak07 marked this pull request as draft March 16, 2025 09:42
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Mar 16, 2025
@Neerajpathak07 Neerajpathak07 marked this pull request as ready for review March 16, 2025 09:55
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 16, 2025
@kgryte kgryte added the Feature Issue or pull request for adding a new feature. label Mar 19, 2025

<section class="related">

* * *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments regarding related packages in newly added packages.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Mar 19, 2025
@Neerajpathak07 Neerajpathak07 requested a review from kgryte March 19, 2025 04:22
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 19, 2025
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Mar 19, 2025
@Neerajpathak07
Copy link
Contributor Author

Neerajpathak07 commented Mar 19, 2025

I have made these changes for other PR's as well!! sorry for the confusion from my side.

/**
* Macro for π².
*/
#define STDLIB_CONSTANT_FLOAT32_PI_SQUARED 9.869604f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sanity check: there are only 6 significant decimal digits for this value in single-precision?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I would do instead is

9.869604401089358f

Meaning take the double-precision value and add an f suffix. The compiler can then take care of proper rounding in C.

Copy link
Contributor Author

@Neerajpathak07 Neerajpathak07 Mar 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh apparently while hovering over the val VS code gave its own rounded off version for this inside 7-decimal places. But I'll make this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Issue or pull request for adding a new feature. Needs Changes Pull request which needs changes before being merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: add constants/float32/pi-squared
4 participants