4 ms·
It's silly because no casts give you an integer type that is too small, but casting to double converts to floating point, performs floating point math, then ass
by asveikau 10y ago
It's silly because no casts give you an integer type that is too small, but casting to double converts to floating point, performs floating point math, then assigns the result to the correct type they should have used in the beginning.
Floating point math in low level C code is very often a WTF. You most often want integers.
- AstralStorm 10y agoSadly, C does not support fixed point arithmetic. You can hack it on top, but the result is super ugly.