3 ms·
If it's 40.00000000001/0.00000000001, things may be different. But since it's just 40.1/0.1, why not just use round()? With such small error, round() should pro
by echaozh 14y ago
If it's 40.00000000001/0.00000000001, things may be different. But since it's just 40.1/0.1, why not just use round()? With such small error, round() should produce 4.
- deelowe 14y agoHe addresses this in the article. Something about cpu usage, yadda yadda. I'm curious as to how he can be so sure about performance though when fundamentally not understanding how floats and ints get converted to binary.
- MikeDucker 14y agoIt's because I'm using ints for position data to allow fast look-ups of nearby objects in a very simple 2D environment. It's not about the speed of the same calculations between floats and ints (if that's what you were wondering).