Skip to content

Commit 5e3d1b3

Browse files
committed
jacobisymbol, legendresymbol: Int->Cint
HT @jlapeyre Ref: julia-users https://groups.google.com/d/topic/julia-users/R5_ks7eAjgg/discussion
1 parent 5a7b050 commit 5e3d1b3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Combinatorics.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ hyperfactorial(n::Integer) = prod([i^i for i = BigInt(2):n])
8383
function jacobisymbol(a::Integer, b::Integer)
8484
ba = BigInt(a)
8585
bb = BigInt(b)
86-
return ccall((:__gmpz_jacobi, :libgmp), Int,
86+
return ccall((:__gmpz_jacobi, :libgmp), Cint,
8787
(Ptr{BigInt}, Ptr{BigInt}), &ba, &bb)
8888
end
8989

@@ -100,7 +100,7 @@ end
100100
function legendresymbol(a::Integer, b::Integer)
101101
ba = BigInt(a)
102102
bb = BigInt(b)
103-
return ccall((:__gmpz_legendre, :libgmp), Int,
103+
return ccall((:__gmpz_legendre, :libgmp), Cint,
104104
(Ptr{BigInt}, Ptr{BigInt}), &ba, &bb)
105105
end
106106

test/basic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
@test lassalle(14) == BigInt("270316008395632253340")
2121

2222
# legendresymbol
23-
@test legendresymbol(1001,9907) == jacobisymbol(1001,9907)
23+
@test legendresymbol(1001,9907) == jacobisymbol(1001,9907) == -1
2424

2525
# lucas
2626
@test lucas(10) == 123

0 commit comments

Comments
 (0)