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

fix incorrect mod rounding #8831

Merged
merged 1 commit into from
Oct 29, 2014
Merged

fix incorrect mod rounding #8831

merged 1 commit into from
Oct 29, 2014

Conversation

simonbyrne
Copy link
Contributor

mod currently gives some incorrect values when it should be exact, e.g.:

julia> mod(prevfloat(1.0),1.0)
0.0

julia> rem(prevfloat(1.0),1.0)
0.9999999999999999

This should fix those problems. I've also tried to improve the documentation of the related functions.

@jiahao
Copy link
Member

jiahao commented Oct 28, 2014

+1

Would be nice to have these specific examples as tests

@simonbyrne
Copy link
Contributor Author

@jiahao done.

nolta added a commit that referenced this pull request Oct 29, 2014
@nolta nolta merged commit 2d5671f into JuliaLang:master Oct 29, 2014
@simonbyrne simonbyrne deleted the mod-fix2 branch March 10, 2015 12:01
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

Successfully merging this pull request may close these issues.

None yet

3 participants