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

QuoRem returns remainder with incorrect scale #187

Open
SoMuchForSubtlety opened this issue Jan 23, 2024 · 0 comments
Open

QuoRem returns remainder with incorrect scale #187

SoMuchForSubtlety opened this issue Jan 23, 2024 · 0 comments

Comments

@SoMuchForSubtlety
Copy link

With the following code, I would expect a quotient of 1 and a remainder of 0.2. What I actually get is 1 and 2.

one := decimal.New(1, 0)
original := decimal.New(12, 1)
quo := &decimal.Big{}
rem := &decimal.Big{}
quo.QuoRem(original, one, rem)
fmt.Println("QuoRem:", quo, rem)

Calling QuoInt and Rem separately yields the expected result.

https://go.dev/play/p/7gQD6VoFgp6

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

1 participant