-
Notifications
You must be signed in to change notification settings - Fork 185
Adding CODATA constants #347
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
Comments
Related discourse thread: https://fortran-lang.discourse.group/t/physical-constants/822 |
Sounds like a duplicate of #99, doesn't it? It's about physical "constants" and all but I think this discussion should be kept there. |
I view #99 as a limited to mathematical constants like |
Scipy put math and physical constants in the same bag under |
I would like to contribute to the stdlib. I worked for my own needs on a fpm package implementing Codata constants. |
Thank you @MilanSkocic for willing to contribute to Implementing Codata constants would be welcome. At this stage I suggest that you open a PR with a first implementation for further discussion. |
I have a working implementation of codata constants (values and uncertainties) as double precision reals. They are implemented as parameters. I'm also working on an implementation with derived types to carry together the values, uncertainties and units. I will try to open a PR by the end of the month. |
@jvdp1 Currently, I have only implemented one precision for the codata constants i.e. real64. CODATA. If different precisions are mandatory then I need to modify my source generator or write another one specifically for generating the module(s) for the standard library. Instead of generating modules (with fixed precision) for different years, I could generate modules with the latest values, i.e 2018, for different precisions. Something similar to what was suggested by @urbanjost in #99. Suffixes for indicating the precision might be problematic because the names are quite long. I was thinking that implementing the uncertainties would be useful. In that case, it might be better to implement the codata constants as derived types. This way, the values, the uncertainties and the units would easily available. |
Idea:
Preliminary repository:
Prior art:
The text was updated successfully, but these errors were encountered: