3 ms·
This is an unsigned int, so the expectation would be to do integer division, which would not get you the same result as multiplying by the inverse.
by jeffasinger 10y ago
This is an unsigned int, so the expectation would be to do integer division, which would not get you the same result as multiplying by the inverse.
- dmichulke 10y agoCouldn't that be addressed via a floor operation afterwards?
- SolarNet 10y agoBecause unless you are on a video card (e.g. doing SIMD) floating point operations are very very expensive.
- adwn 10y agoThat is not true; compare kr7's comment [1]: > On Skylake [...] 32/64-bit floating point multiplication has a 4 cycle latency with a throughput of 2 instructions / cycle. Of course, there are some operations that are very expensive (trigonometric functions, for example), but they're not necessary here, and they're also very expensive on the GPU. [1] https://news.ycombinator.com/item?id=13693749 https://news.ycombinator.com/item?id=13693749