Skip to content

Commit

Permalink
Upgrade MPFR to 4.0.0 (#25710)
Browse files Browse the repository at this point in the history
See http://www.mpfr.org/mpfr-current/#changes

Now includes a `beta` function.
  • Loading branch information
simonbyrne authored Jan 25, 2018
1 parent e23b2ab commit fbaffc7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 4 deletions.
9 changes: 8 additions & 1 deletion base/mpfr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import
cosh, sinh, tanh, sech, csch, coth, acosh, asinh, atanh, atan2,
cbrt, typemax, typemin, unsafe_trunc, realmin, realmax, rounding,
setrounding, maxintfloat, widen, significand, frexp, tryparse, iszero,
isone, big
isone, big, beta

import Base.Rounding: rounding_raw, setrounding_raw

Expand Down Expand Up @@ -680,6 +680,13 @@ function atan2(y::BigFloat, x::BigFloat)
ccall((:mpfr_atan2, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Ref{BigFloat}, Int32), z, y, x, ROUNDING_MODE[])
return z
end
if version() >= v"4.0.0"
function beta(y::BigFloat, x::BigFloat)
z = BigFloat()
ccall((:mpfr_beta, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Ref{BigFloat}, Int32), z, y, x, ROUNDING_MODE[])
return z
end
end

# Utility functions
==(x::BigFloat, y::BigFloat) = ccall((:mpfr_equal_p, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}), x, y) != 0
Expand Down
2 changes: 1 addition & 1 deletion deps/Versions.make
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SUITESPARSE_VER = 4.4.5
UNWIND_VER = 1.1-julia2
OSXUNWIND_VER = 0.0.3
GMP_VER = 6.1.2
MPFR_VER = 3.1.6
MPFR_VER = 4.0.0
PATCHELF_VER = 0.9
MBEDTLS_VER = 2.6.0
CURL_VER = 7.56.0
1 change: 0 additions & 1 deletion deps/checksums/mpfr-3.1.6.tar.bz2/md5

This file was deleted.

1 change: 0 additions & 1 deletion deps/checksums/mpfr-3.1.6.tar.bz2/sha512

This file was deleted.

1 change: 1 addition & 0 deletions deps/checksums/mpfr-4.0.0.tar.bz2/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ef619f3bb68039e35c4a219e06be72d0
1 change: 1 addition & 0 deletions deps/checksums/mpfr-4.0.0.tar.bz2/sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
43932f9d5e60fd5545c27ff984784dd7a286656a0297d0be7c106f72a2d2e0408702be16bd27e5b5f17a04a2069d06d644cdb4ca4ab4c26ae1a5896fc77bdefd
2 changes: 2 additions & 0 deletions test/mpfr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -921,3 +921,5 @@ end
@test to_string(big"-1.0") == "-1.0"
end
end

@test beta(big(1.0),big(1.2)) beta(1.0,1.2) rtol=4*eps()

0 comments on commit fbaffc7

Please sign in to comment.