nqp icon indicating copy to clipboard operation
nqp copied to clipboard

pow_I missing some special cases

Open jnthn opened this issue 12 years ago • 3 comments

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.

jnthn avatar Apr 08 '13 22:04 jnthn

I would be happy to help with what is need on the Parrot side. Should Parrot and JVM have their own Github issues?

leto avatar Apr 09 '13 05:04 leto

@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 avatar Apr 09 '13 08:04 jnthn

@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 :)

leto avatar Apr 09 '13 17:04 leto