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

bug: a.Mod(b) returns a negative number #210

Closed
basnijholt opened this issue Feb 3, 2021 · 2 comments
Closed

bug: a.Mod(b) returns a negative number #210

basnijholt opened this issue Feb 3, 2021 · 2 comments

Comments

@basnijholt
Copy link

	a := decimal.RequireFromString("0.499999999999999999")
	b := decimal.RequireFromString("0.25")
	fmt.Println(a.Mod(b))

prints -0.000000000000000001.

It should never be possible for the number to become negative.

@mwoss
Copy link
Member

mwoss commented Feb 3, 2021

Thanks for spotting that bug! I will take a look. :)

@mwoss
Copy link
Member

mwoss commented Jan 10, 2024

Completly forgot about this issue. This bug has been fixed twice in #258 and #317 :D

@mwoss mwoss closed this as completed Jan 10, 2024
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