Skip to content

Commit ccf7fd7

Browse files
authored
Update IntegerMathUtils.jl
fixes #19
1 parent f1db151 commit ccf7fd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/IntegerMathUtils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ iroot(x::T, n::Cint) where {T<:Integer} = T(iroot(big(x), Cint(n)))
88

99
function iroot(x::BigInt, n::Cint)
1010
n <= 0 && throw(DomainError(n, "Exponent must be > 0"))
11-
x <= 0 && iseven(x) && throw(DomainError(n, "This is a math no-no"))
11+
x <= 0 && iseven(n) && throw(DomainError(n, "This is a math no-no"))
1212
ans = BigInt()
1313
@ccall :libgmp.__gmpz_root(ans::Ref{BigInt}, x::Ref{BigInt}, n::Cint)::Cint
1414
ans

0 commit comments

Comments
 (0)