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 rational vs float comparisons (attempt 2) #9198

Merged
merged 3 commits into from
Jan 29, 2015

Conversation

simonbyrne
Copy link
Contributor

This fixes FloatingPoint vs Rational inequality comparisons (see #2960 and #8411), replacing #8463: unlike that attempt, it doesn't try to completely modify the whole dispatch system, so is much simpler, and less likely to break anything.

After this, the only remaining possibly inexact comparisons should be Rational vs MathConst.

@StefanKarpinski
Copy link
Member

I guess I had better read this carefully but it looks pretty good at first impression.

@tkelman
Copy link
Contributor

tkelman commented Nov 30, 2014

Linux and Win64 CI failures were unrelated, but Win32 looks like a legit issue:

exception on 2: ERROR: test error in expression: 1 / 3 < 1 // 3
InexactError()
 in decompose at hashing2.jl:127
 in anonymous at test.jl:83
 in do_test at test.jl:47
 in runtests at C:\projects\julia\test\testdefs.jl:5
 in anonymous at multi.jl:828
 in run_work_thunk at multi.jl:593
 in anonymous at task.jl:828
while loading numbers.jl, in expression starting on line 800

@simonbyrne
Copy link
Contributor Author

It appears to be an existing bug in decompose. I'll push a fix.

@simonbyrne
Copy link
Contributor Author

Okay, hopefully that fixes it. I've also added some extra tests to check decompose does the right thing.

@tkelman
Copy link
Contributor

tkelman commented Nov 30, 2014

That worked on appveyor. I have no idea what's wrong with Linux Travis, I think someone will need to spend some time in a docker container or VM of Ubuntu 12.04 to try to reproduce whatever's happening there.

@simonbyrne
Copy link
Contributor Author

I've managed to get an Ubuntu 12.04 VM running, but I get different errors on the tests:

    ....
     * socket
     * floatapprox
     * readdlm
Killed
make[1]: *** [all] Error 137
make: *** [testall] Error 2

@simonbyrne
Copy link
Contributor Author

I also get a different on on collections:

    JULIA test/collections
     * collections
exception on 1: ERROR: MemoryError()
 in resize! at ./array.jl:504
 in sizehint at ./intset.jl:23
 in push! at ./intset.jl:42
 in call at deprecated.jl:115
 in runtests at /home/vagrant/src/julia/test/testdefs.jl:5
 in anonymous at multi.jl:632
 in run_work_thunk at multi.jl:593
 in remotecall_fetch at multi.jl:666
 in remotecall_fetch at multi.jl:681
 in anonymous at task.jl:1450
while loading collections.jl, in expression starting on line 520
ERROR: MemoryError()
 in resize! at ./array.jl:504
 in sizehint at ./intset.jl:23
 in push! at ./intset.jl:42
 in call at deprecated.jl:115
 in runtests at /home/vagrant/src/julia/test/testdefs.jl:5
 in anonymous at multi.jl:632
 in run_work_thunk at multi.jl:593
 in remotecall_fetch at multi.jl:666
 in remotecall_fetch at multi.jl:681
 in anonymous at task.jl:1450
while loading collections.jl, in expression starting on line 520
while loading /home/vagrant/src/julia/test/runtests.jl, in expression starting on line 42

make[1]: *** [collections] Error 1
make: *** [test-collections] Error 2

but I can at least comment that one out.

@simonbyrne
Copy link
Contributor Author

I don't know why that worked, all I did was rebase. But it seems good to go.

@tkelman
Copy link
Contributor

tkelman commented Dec 1, 2014

Looks like you did fix the original problem in decompose, the other issue is an intermittent thing that I don't think you caused, sorry if that was unclear. I have #9176 open since there are several intermittent failures happening on Linux Travis lately.

@simonbyrne
Copy link
Contributor Author

I've just added an extra patch that should also fix FloatingPoint vs MathConst and Rational vs MathConst. So now all comparisons should be exact, except for some edge cases in BigFloat vs MathConst and Rational{BigInt} vs MathConst.

@simonbyrne simonbyrne mentioned this pull request Dec 22, 2014
8 tasks
@simonbyrne
Copy link
Contributor Author

Bump?

StefanKarpinski added a commit that referenced this pull request Jan 29, 2015
fix rational vs float comparisons (attempt 2)
@StefanKarpinski StefanKarpinski merged commit 2bf7446 into JuliaLang:master Jan 29, 2015
@simonbyrne simonbyrne deleted the rational3 branch March 10, 2015 12:02
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.

3 participants