-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
"Questionable Pull": Fixed BigInt bug & added BigFloat #532
Conversation
I probably should have split this into two pull requests -- the first to fix BigInt, and the second to add BigFloat. If you only want to do the former, you can change gmp_wrapper.c _jl_mpz_printf to the following:
|
I've managed to get the converts changed enough to give us correct arithmetic
However, some more work is needed on the comparisons. In general, == will not work for comparing floats on the tests, we'll need to use Another minor comment: do we want to implicitly convert Unsigned values? or just singed ones? |
@choffstein : The following is the diff that I have to your bigfloat at the moment.
|
"Questionable Pull": Fixed BigInt bug & added BigFloat. Merging the whole thing for now, since it won't affect anything else.
Hmm, i don't think type-conversion is the problem. The tests fail even if the float literals are replaced with BigFloats. Are you sure the tests shouldn't fail? I came across this in the manual:
|
Yes, of course, tests like (a + .00000001 == b) will never work. However, I would expected, for example, (a + .00000001 -b < .00000001 ) to work. Visually, given the rounding errors, that should work. Even more simply, a > 0.0 does not work, but a > BigFloat(0) does . Note that you'll need to apply my diff above, otherwise the addition itself does not work correctly. |
Yeah, momentary lapse. I was thinking that they were infinite precision structures -- but they aren't. Thanks for helping to clean it up. |
There is an assert_approx_eq macro in runtest.jl now that seems to compare to an difference of 1.0e-6 |
This makes `src/builtins.jl` in sync with `bin/generate_builtins.jl` again. A lot of this code was also out-of-date, now that we only support 1.6, so this includes some cleanup.
Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: main Julia branch: master Old commit: a09f90b New commit: 82b385f Julia version: 1.12.0-DEV SparseArrays version: 1.12.0 Bump invoked by: @LilithHafner Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaSparse/SparseArrays.jl@a09f90b...82b385f ``` $ git log --oneline a09f90b..82b385f 82b385f Make tests expect FieldError exception once that exception is available in Base 9d4397f Sparse versions of repeat for matrices and vectors (#532) ``` Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: main Julia branch: master Old commit: a09f90b New commit: 82b385f Julia version: 1.12.0-DEV SparseArrays version: 1.12.0 Bump invoked by: @LilithHafner Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaSparse/SparseArrays.jl@a09f90b...82b385f ``` $ git log --oneline a09f90b..82b385f 82b385f Make tests expect FieldError exception once that exception is available in Base 9d4397f Sparse versions of repeat for matrices and vectors (#532) ``` Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
…aLang#54576) Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: main Julia branch: master Old commit: a09f90b New commit: 82b385f Julia version: 1.12.0-DEV SparseArrays version: 1.12.0 Bump invoked by: @LilithHafner Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaSparse/SparseArrays.jl@a09f90b...82b385f ``` $ git log --oneline a09f90b..82b385f 82b385f Make tests expect FieldError exception once that exception is available in Base 9d4397f Sparse versions of repeat for matrices and vectors (JuliaLang#532) ``` Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
I fixed a bug in the wrapper library and added some code to enable a BigFloat.
Unfortunately, my BigFloat tests don't pass because I haven't quite figured out the type-conversions. If someone knowledgable can take a look at jl/bigfloat.jl at the conversions, they should be fix it pretty quickly to get the tests passing.