4 ms·
If only IEEE-754 math worked as infinite-precision math. You should first learn some basics about floating point numbers before attempting to make such strong a
by tagrun 10y ago
If only IEEE-754 math worked as infinite-precision math.
You should first learn some basics about floating point numbers before attempting to make such strong assertions to correct people with such a bossy attitude (you're 100% wrong BTW).
Here's a quick exercise for you:
#include <stdio.h>
int main() {
float x = 123456789.5;
printf("%f\n", x);
return 0;
}
prints
123456792.000000
And the distance between two nearest floats grow larger as you go away from 0. So the nearest existing integers aren't 123456790 or 123456788 either.
- SamReidHughes 10y agoMeanwhile, 2 - 1.5 == 1.5 - 1, and in half the integer range, the .5's can be represented exactly.
- tagrun 10y agoI think I've wasted enough time with your ignorant ramblings. Yeah, yeah, go and live with your delusions happily ever, "pal". Shoo.
- SamReidHughes 10y agoGuess what pal, even IEEE defines the round to even mode for results exactly between two integers (when they're the nearest representable values).