You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JuliaExperimental calls AbsInt and GcdInt with rationals as arguments, which cannot work and will lead to crashes and/or corrupt data.
Note there is a kernel function AbsRat which can be used instead of AbsInt. This function is also available on the GAP level as ABS_RAT, so it could also be called as GAP.GAPFuncs.ABS_RAT. However, this may be slower compared to the ccall, see also issue #68 . Another thing one could try is to simply use ccall(:AbsRat, ..., i.e. without setting up a wrapper in gap_macros.c
For GcdInt, it is unclear to me what the intended meaning is when computing the gcd of two rationals. I'd say it is always 1 (and GAP agrees), except of course if both inputs are 0.
Lastly, create_rational is rather dangerous, as it allows creating denormalized rationals, such as 2/1, 8/4, 3/0 or 2/-1. GAP is not prepared for this -- it expects rationals to always have a denominator > 1. If that rules is violated, then e.g. the rational 2/1 in GAP is not equal to the integer 2.
I suggest to instead call the GAP kernel function QuoRat, which accepts both rationals and integers as arguments.
Lastly, with the current master branch, the wrapper functions MyFuncLT in the kernel are no longer necessary, as LT etc. all were converted from macros into functions.
The text was updated successfully, but these errors were encountered:
This code is not needed anymore due the existence of the convenience wrappers
for arithmetic operations on GAP objects in Julia, resp. on Julia objects in
GAP.
Moreover, this code was buggy; and was not yet converted to use
`ForeignGAP.MPtr` (leading to GC crash). All in all, it seems best to
"conclude" this experiment by removing it.
Resolvesoscar-system#71
This code is not needed anymore due the existence of the convenience wrappers
for arithmetic operations on GAP objects in Julia, resp. on Julia objects in
GAP.
Moreover, this code was buggy; and was not yet converted to use
`ForeignGAP.MPtr` (leading to GC crash). All in all, it seems best to
"conclude" this experiment by removing it.
Resolves#71
JuliaExperimental calls
AbsInt
andGcdInt
with rationals as arguments, which cannot work and will lead to crashes and/or corrupt data.Note there is a kernel function
AbsRat
which can be used instead ofAbsInt
. This function is also available on the GAP level asABS_RAT
, so it could also be called asGAP.GAPFuncs.ABS_RAT
. However, this may be slower compared to the ccall, see also issue #68 . Another thing one could try is to simply useccall(:AbsRat, ...
, i.e. without setting up a wrapper ingap_macros.c
For
GcdInt
, it is unclear to me what the intended meaning is when computing the gcd of two rationals. I'd say it is always 1 (and GAP agrees), except of course if both inputs are 0.Lastly,
create_rational
is rather dangerous, as it allows creating denormalized rationals, such as 2/1, 8/4, 3/0 or 2/-1. GAP is not prepared for this -- it expects rationals to always have a denominator > 1. If that rules is violated, then e.g. the rational2/1
in GAP is not equal to the integer 2.I suggest to instead call the GAP kernel function
QuoRat
, which accepts both rationals and integers as arguments.Lastly, with the current master branch, the wrapper functions
MyFuncLT
in the kernel are no longer necessary, asLT
etc. all were converted from macros into functions.The text was updated successfully, but these errors were encountered: