# to the nth power

Doug Gwyn gwyn at smoke.brl.mil
Wed Nov 7 22:27:22 AEST 1990


In article <ENAG.90Nov3145415 at hild.ifi.uio.no> enag at ifi.uio.no (Erik Naggum) writes:
-In article <1990Nov2.182217.13958 at NCoast.ORG> catfood at NCoast.ORG (Mark W. Schumann) writes:
-   Spiffy, but it does depend on (exponent & 1) being the same as saying
-   "exponent is odd."  Most implementations support this, though.

That's good, because the C standard requires this, for positive integers.

-For a ones-complement architectures, this even holds for negative
-integers.  Twos-complement architectures will return "odd" for an even
-negative number in this simple test.  Was that what you were thinking of?

Other way around.



More information about the Comp.lang.c mailing list