logoalt Hacker News

lacedeconstructyesterday at 7:10 PM3 repliesview on HN

yes but >> 8 is so much faster


Replies

xigoiyesterday at 8:14 PM

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.

show 1 reply
StilesCrisisyesterday at 8:06 PM

It's just multiplication. Floating multiply is extraordinarily fast.

show 1 reply
dist-epochyesterday at 7:41 PM

Only in micro-benchmarks.

For real usage, today's CPUs are limited by memory bandwidth.

show 2 replies