top | item 44825394

(no title)

chriseing | 6 months ago

The correct answer. In particular, up to 2 ^ 24 the float32 behaves like a regular integer, which can be important in some cases. Above that value, the integer starts to have missing values, and strange int behavior such as (n+1)+1 not equal to (n+2)

discuss

order

yosefk|6 months ago

But why are 32b floats relevant? JS, the language famously representing ints as floats, uses 64b floats. Who puts ints into 32b floats and cares about precision loss?

matthewmacleod|6 months ago

Layout engines are not implemented in Javascript.

chriseing|6 months ago

I didn't say JavaScript anywhere in my comment. No relation to JavaScript. Rendering is typically done in tiles, in GPU, and the best precision that can be used across all GPUs is float32. Some GPUs don't implement float64.

bobmcnamara|6 months ago

Plenty of embedded GPUs do coordinates that way. But I doubt they're running browsers.