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

Inconsistencies with associativity of multiplication. #637

Open
dex-k opened this issue Oct 25, 2024 · 2 comments
Open

Inconsistencies with associativity of multiplication. #637

dex-k opened this issue Oct 25, 2024 · 2 comments

Comments

@dex-k
Copy link

dex-k commented Oct 25, 2024

Hi, I just came across Numbat from this post, and went to try it out. After skimming the documentation, I tried to do a currency conversion:

>>> 1 usd * ( aud / usd )

  1 dollar × (australian_dollar / dollar)

      = 1 AUD    [Money]

>>> aud / usd

  australian_dollar / dollar

      = 0.665332

>>> 1 usd * 0.665332

  1 dollar × 0.665332

      = 0.665332 $    [Money]

>>> 1 * usd * (aud/usd)

  1 dollar × (australian_dollar / dollar)

      = 1 AUD    [Money]

>>> 1 * (aud/usd) * usd

  1 × (australian_dollar / dollar) × dollar

      = 0.665332 $    [Money]

Having read the (seemingly) relevant parts of the documentation again, I don't understand why all of the former snippets don't evaluate to the same result. Is this intended behaviour?

@Goju-Ryu
Copy link
Contributor

This looks a bit odd. I think it might be associated with the issues discussed following this comment on another issue.

And just in case you are unaware, it looks like you are trying to convert between currencies which is much more easily done this way: 1 usd -> aud or with the keyword to instead of the arrow if you prefer.

@dex-k
Copy link
Author

dex-k commented Oct 26, 2024

Thank you, that's helpful to know.

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

No branches or pull requests

2 participants