Skip to content

Commit

Permalink
Probably fix bigfib failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Aug 30, 2013
1 parent 9b6496a commit b81112f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion base/gmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ function string(x::BigInt)
lng = ndigits(x) + 2
z = Array(Uint8, lng)
lng = ccall((:__gmp_snprintf,:libgmp), Int32, (Ptr{Uint8}, Culong, Ptr{Uint8}, Ptr{BigInt}...), z, lng, "%Zd", &x)
return bytestring(convert(Ptr{Uint8}, z[1:lng]))
return bytestring(z[1:lng])
end

function show(io::IO, x::BigInt)
Expand Down
6 changes: 3 additions & 3 deletions base/mpfr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -705,10 +705,10 @@ end
function string(x::BigFloat)
lng = 128
for i = 1:2
z = Array(Uint8, lng)
lng = ccall((:mpfr_snprintf,:libmpfr), Int32, (Ptr{Uint8}, Culong, Ptr{Uint8}, Ptr{BigFloat}...), z, lng, "%.Re", &x) + 1
z = Array(Uint8, lng + 1)
lng = ccall((:mpfr_snprintf,:libmpfr), Int32, (Ptr{Uint8}, Culong, Ptr{Uint8}, Ptr{BigFloat}...), z, lng + 1, "%.Re", &x)
if lng < 128 || i == 2
return bytestring(convert(Ptr{Uint8}, z[1:lng]))
return bytestring(z[1:lng])
end
end
end
Expand Down

0 comments on commit b81112f

Please sign in to comment.