You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> round(((12.34±0.02)u"m")/1.0u"m", sigdigits=2)u"m"
12.0 ± 0.02 m
This is counterintuitive and, frankly, incorrect. I expect a result where the uncertainty has been extended to represent the rounding, e.g. 12.0 ± 0.5 m (for the nearest rounding mode). Arguably also correct would be 12.0 ± 1.0 m (round both the value and the uncertainty to the same digit, not to the same sigdigits).
The text was updated successfully, but these errors were encountered:
I agree that this could be counterintuitive, but I think the real problem is that method is ambiguous: what does "sigdigits" refers to? Everybody can claim that The Right Answer™ is either "to the value" or "to the uncertainty". You also suggest this.
Note that this is unrelated to Unitful.jl:
julia>round(12.34±0.02, sigdigits=2)
12.0±0.02
giordano
changed the title
Incorrect Rounding with Unitful
Incorrect rounding when using sigdigits keyword argument
Aug 3, 2019
This is counterintuitive and, frankly, incorrect. I expect a result where the uncertainty has been extended to represent the rounding, e.g.
12.0 ± 0.5 m
(for the nearest rounding mode). Arguably also correct would be12.0 ± 1.0 m
(round both the value and the uncertainty to the same digit, not to the same sigdigits).The text was updated successfully, but these errors were encountered: