We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1db151 commit ccf7fd7Copy full SHA for ccf7fd7
1 file changed
src/IntegerMathUtils.jl
@@ -8,7 +8,7 @@ iroot(x::T, n::Cint) where {T<:Integer} = T(iroot(big(x), Cint(n)))
8
9
function iroot(x::BigInt, n::Cint)
10
n <= 0 && throw(DomainError(n, "Exponent must be > 0"))
11
- x <= 0 && iseven(x) && throw(DomainError(n, "This is a math no-no"))
+ x <= 0 && iseven(n) && throw(DomainError(n, "This is a math no-no"))
12
ans = BigInt()
13
@ccall :libgmp.__gmpz_root(ans::Ref{BigInt}, x::Ref{BigInt}, n::Cint)::Cint
14
ans
0 commit comments