logoalt Hacker News

xigoiyesterday at 8:14 PM1 replyview on HN

You don’t divide a float by 256 by shifting it right eight bits; that would yield complete garbage. You subtract 8 from the exponent, then check if you got an underflow.


Replies

dheerayesterday at 9:05 PM

Same point; divide by power of 2 is a fast subtraction operation in float world, while divide by 255 shits all over the whole float

show 1 reply