Repository navigation
Conversation
constant::range(), used by ConstantRange and by the right-shifted key of the constants menus, built a delta range a±b from the value and the second field of the constant. That field is a standard uncertainty: StandardUncertainty returns it, and CODATA gives "the one-standard-deviation uncertainty". A bound and a standard deviation do not combine the same way, and they do not mix: a constant times a user's ±σ measurement gave "Bad argument type". ConstantRange now builds an uncertain value a±σb. Exact constants give x±σ0. The 108 test expectations that showed a constant range change from ± to ±σ; for Undefined the centre is no longer recomputed as (lo+hi)/2. ConstantRange had no help: the new entry shows it on the stack and in an algebraic expression, and says how to cycle a value with a unit. Fixes c3d#1850. Author & design: Jean Wilson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CstRng was only on the third page of the Parts menu. The Range menu, where the other ways to build a range are, had room for it: it goes last, so that no existing key moves. Author & design: Jean Wilson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The standard uncertainties of the electron magnetic moment to Bohr magneton ratio and of the neutron to proton mass ratio were 1.1E-13 and 5.1E-10, while CODATA 2022 gives 1.8E-13 and 4.0E-10. Their relative uncertainties were recomputed from those of the two terms of the ratio, as if they were independent; CODATA adjusts these ratios directly, with the correlations, so they now use the published values. The other 69 CODATA constants of the library agree with CODATA 2022, in value and uncertainty, when compared with the NIST table (allascii.txt). Author & design: Jean Wilson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wiljea
force-pushed
the
fix-codata-ratio-uncertainties
branch
from
November 5, 2026 15:18
c13b31e to
c4a8a40
Compare
Author
|
Rebased on #1852 (fix-constant-range-sigma), which touched the same two test lines for μeμB and mnmp. Please merge #1852 first; this PR then merges without conflict. Author & design: Jean Wilson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
I compared the 100 constants of the library outside Astronomy and Materials
with the CODATA 2022 table of NIST (
allascii.txt), evaluating each value andits standard uncertainty in SI units with 24 digits. The 71 that are in CODATA
agree in value (all within 0.05 σ, exact ones to the printed digits). Two
uncertainties do not:
μeμB, electron magnetic moment to Bohr magneton ratiomnmp, neutron to proton mass ratioTheir relative uncertainties were recomputed from the two terms of the ratio
(
Ⓢμe/Ⓒμe;Ⓢmn/Ⓒmn+Ⓢmp/Ⓒmp), as if they were independent. CODATA adjuststhese ratios directly, with the correlations, so the published uncertainty is
the one to use.
Fix
Both take the CODATA 2022 standard uncertainty, and their relative uncertainty
is computed from it. The two expectations of
src/tests.ccthat show theseconstants follow.
These two lines also change in #1852 (
±becomes±σ). Whichever is mergedsecond has a one-line conflict on each; the final expectations are
-1.00115 96521 8±σ1.8⁻¹³and1.00137 84194 6±σ4.⁻¹⁰.Tests
Full test suite on the current
devwith this commit: DB48x 8455 pass, 0 fail,as on
devalone.Author & design: Jean Wilson
🤖 Generated with Claude Code