It’s obvious in retrospect, but working with floats all the time has really made me appreciate defensive programming.
-
Show this thread
-
With floats, there’s almost always *some* valid input that will make your algorithm behave badly, and you have to recover as best you can.
3 replies 4 retweets 21 likesShow this thread -
Replying to @pcwalton
I was just talking to someone in the team about this! Do you know if browser algos are known to work well on floats, and where? Or do people usually just do doubles to be “safe”? The person I asked didn’t know either.
1 reply 0 retweets 0 likes -
Replying to @jfbastien
Which browser algorithms in particular? Painting, layout, …?
1 reply 0 retweets 0 likes -
Replying to @pcwalton
All! I’m not familiar with them, and I was asking why we use double/float where we do. Sounds like underlying OS code uses double, and intermediates being in float have cause bugs for some inputs before.
1 reply 0 retweets 0 likes -
Replying to @jfbastien
Layout in Gecko/Servo uses fixed point (1/60 px). WebRender/Pathfinder uses f32 and tries its best to work on real world inputs.
1 reply 0 retweets 2 likes
(The GPU pretty much forces you into f32, especially old GPUs which we primarily target…)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.