nqp
nqp copied to clipboard
pow_I missing some special cases
Should look into these for both Parrot and JVM backends:
< BenGoldberg> Your big integer pow_I is missing a few special cases...
< BenGoldberg> When the exponent is positive and even, and the base is
neg one, return pos one
< BenGoldberg> When the exponent is positive and odd, and the base is neg
one, return neg one
< BenGoldberg> When the exponent is huge, and the base is less than neg
one, return either Inf or -Inf depending on whether the
exponent is odd or even
< BenGoldberg> When the exponent is negative, and the base is zero,
return Inf
< BenGoldberg> In that last case, you might want to throw a division by
zero, instead.
I would be happy to help with what is need on the Parrot side. Should Parrot and JVM have their own Github issues?
@leto the code for the Parrot side of things actually lives in the NQP repository, in the nqp_bigint.ops.
As for separate issues, no, the JVM stuff will be moving into this same repository soon anyway, since a vast majority of the code between the two is shared.
@jnthn thanks for clarifying. Do I need to do much else other than add some conditional cases to nqp_bigint.ops? I haven't touched nqp in ages :)