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

Missing constants #13

Closed
OTSim opened this issue Jul 22, 2023 · 3 comments
Closed

Missing constants #13

OTSim opened this issue Jul 22, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@OTSim
Copy link
Collaborator

OTSim commented Jul 22, 2023

The file value/vdouble/scalar/base/Constants.java defines a number of physical and mathematical constants.
Sorely missing are:
pi (but we do have tau)
e (Euler's constant)
Slighly less important (because it is quite easy to "construct"):
phi (The golden ratio; (1+sqrt(5)/2)

@averbraeck
Copy link
Owner

The constants E, PHI and PI have been added as Dimensionless constants to the Constants class, and as FloatDimensionless constants to the FloatConstants class. Additionally, the FloatConstants class now contains FloatSIScalar, FloatDimensionless, FloatMass, etc, where the previous version defined double constants (which was clearly wrong).

@averbraeck
Copy link
Owner

The unit tests have also been adapted to test the float values in FloatConstants up to 1 ulp precision for the expected value.

@averbraeck
Copy link
Owner

All unit tests for Constants and FloatConstants pass, so this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants