Skip to content

Commit

Permalink
vdim: avoid overflow (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes14 authored Nov 22, 2023
1 parent 700dfbb commit 3caa218
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deps/src/ideals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ void singular_define_ideals(jlcxx::Module & Singular)
Singular.method("id_vdim", [](ideal I, ring r) {
const ring origin = currRing;
rChangeCurrRing(r);
int n = scMult0Int(I, r->qideal);
long n = scMult0Int(I, r->qideal);
rChangeCurrRing(origin);
return n;
});
Expand Down
2 changes: 1 addition & 1 deletion src/ideal/ideal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ function vdim(I::sideal{S}) where {T <: Nemo.FieldElem,
S <: Union{spoly{T}, spluralg{T}}}
I.isGB || error("Not a Groebner basis")
R = base_ring(I)
GC.@preserve I R return Int(libSingular.id_vdim(I.ptr, R.ptr))
GC.@preserve I R return Int64(libSingular.id_vdim(I.ptr, R.ptr))
end

@doc raw"""
Expand Down
2 changes: 1 addition & 1 deletion src/module/module.jl
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ end
function vdim(I::smodule)
I.isGB || error("Not a Groebner basis")
R = base_ring(I)
GC.@preserve I R return Int(libSingular.id_vdim(I.ptr, R.ptr))
GC.@preserve I R return Int64(libSingular.id_vdim(I.ptr, R.ptr))
end

###############################################################################
Expand Down

0 comments on commit 3caa218

Please sign in to comment.