3 ms·
It is shocking to think about it, but a lot of programmers don’t think about bits at all, and just think of floats as reals. Or maybe if you prod them enough, t
by bee_rider 1y ago
It is shocking to think about it, but a lot of programmers don’t think about bits at all, and just think of floats as reals. Or maybe if you prod them enough, they’ll treat the floats as sometimes inaccurate reals.
- haiku2077 1y agoI cringe whenever I hear floats described as "decimals" :(
- bee_rider 1y agoI try not to be too picky about this sort of stuff, but “decimals” is really bad, haha! It is like wrong in a way that is specific, which somehow makes it even more wrong than just saying “approximately reals.” IEEE actually has a decimal float format defined. I don’t know if any system uses it, though (my suspicion is it must be pretty niche).
- adastra22 1y agoBecause int -> float is well defined. If you cast an int to a float, you’re getting a value that represents the first six significant figures of the original integer. Always. The precision of casting float to int, on the other hand, depends on the input.