Skip to content

Commit

Permalink
ispos -> ispositive
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet committed May 10, 2017
1 parent b521acd commit d241467
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions base/gmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function convert(::Type{T}, x::BigInt) where T<:Signed
else
0 <= n <= cld(sizeof(T),sizeof(Limb)) || throw(InexactError())
y = x % T
ispos(x) (y > 0) && throw(InexactError()) # catch overflow
ispositive(x) (y > 0) && throw(InexactError()) # catch overflow
y
end
end
Expand Down Expand Up @@ -506,7 +506,7 @@ function sum(arr::AbstractArray{BigInt})
end

function factorial(x::BigInt)
isneg(x) && return BigInt(0)
isnegative(x) && return BigInt(0)
z = BigInt()
ccall((:__gmpz_fac_ui, :libgmp), Void, (Ptr{BigInt}, Culong), &z, x)
return z
Expand Down Expand Up @@ -537,10 +537,10 @@ iszero(x::BigInt) = x.size == 0
<(i::Integer, x::BigInt) = cmp(x,i) > 0
<(x::BigInt, f::CdoubleMax) = isnan(f) ? false : cmp(x,f) < 0
<(f::CdoubleMax, x::BigInt) = isnan(f) ? false : cmp(x,f) > 0
isneg(x::BigInt) = x.size < 0
ispos(x::BigInt) = x.size > 0
isnegative(x::BigInt) = x.size < 0
ispositive(x::BigInt) = x.size > 0

signbit(x::BigInt) = isneg(x)
signbit(x::BigInt) = isnegative(x)
flipsign!(x::BigInt, y::Integer) = (signbit(y) && (x.size = -x.size); x)
flipsign( x::BigInt, y::Integer) = signbit(y) ? -x : x

Expand Down

0 comments on commit d241467

Please sign in to comment.