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

Inconsistency in arithmetic expressions? #47

Closed
heitorPB opened this issue Jun 18, 2019 · 1 comment
Closed

Inconsistency in arithmetic expressions? #47

heitorPB opened this issue Jun 18, 2019 · 1 comment
Labels
not a bug but a feature

Comments

@heitorPB
Copy link

Is this expected?

julia> (1234 ± 1) / (1234 ± 1)
1.0 ± 0.0011

julia> (1234 ± 1) - (1234 ± 1)
0.0 ± 1.4

julia> x = (1234 ± 1)
1234.0 ± 1.0

julia> x / x
1.0 ± 1.1e-19

julia> x - x
0.0 ± 0.0
@giordano
Copy link
Member

Yes, this is expected and actually a desired behaviour: it allows us to distinguish between two different measurements that share by chance the same value and uncertainty (the first case in your example) from two quantities that are actually the same measurement (the second case in your example).

This is also explained in the documentation, see https://juliaphysics.github.io/Measurements.jl/stable/usage/#Usage-1 (in particular the "Note" box and the "Correlation Between Variables" section)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug but a feature
Projects
None yet
Development

No branches or pull requests

2 participants