Re:Write A Function To Determine If A Number Is A Power Of 2
by effigies on Monday October 18, 2010 @12:18PM
(#1804045)
With floating point, the first 9 bits are sign and exponent. You could thus check with:
This only works for exact powers of two, though. It's possible to get something that's really close that will fail this.
[ Parent
| on HN ]
There are no comments on this comment yet.