Skip to content

Commit 5da2da2

Browse files
conversions to/from BigFloat
1 parent 498e041 commit 5da2da2

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ get_float128.o: get_float128.c
1010
gcc -O3 -fpic -c -I/home/hofi/LibDownloads/mpfr-3.1.3/src -I/home/hofi/include -o get_float128.o -I/home/hofi/LibDownloads/mpfr-3.1.3/src/x86_64/core2 get_float128.c
1111

1212
libfloat128.so: float128.o set_float128.o get_float128.o
13-
gcc -shared -o libfloat128.so float128.o set_float128.o get_float128.o -lquadmath -L/usr/lib/sagemath/local/lib/ -lmpfr
13+
gcc -shared -o libfloat128.so float128.o set_float128.o get_float128.o /usr/lib/x86_64-linux-gnu/libmpfr.so.4 -lquadmath
1414

1515

1616

float128.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ const ROUNDING_MODE = Cint[0]
275275

276276
function convert(::Type{BigFloat}, x::Float128)
277277
z = BigFloat()
278-
ccall((:mpfr_set_float128_xxx, :libfloat128), Int32, (Ptr{BigFloat}, Float128, Int32), &z, x, ROUNDING_MODE[end])
278+
res = ccall((:mpfr_set_float128_xxx, :libfloat128), Int32, (Ptr{BigFloat}, Float128, Int32), &z, x, ROUNDING_MODE[end])
279279
return z
280280
end
281281

set_float128.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
2323

2424
#define MPFR_WANT_FLOAT128
2525
#define IEEE_FLOAT128_MANT_DIG 113
26+
#define MPFR_USE_THREAD_SAFE
27+
2628

2729
#include <float.h> /* for DBL_MAX */
2830

0 commit comments

Comments
 (0)