yeah, it's basically the same problem as the one that resulted in that fabulous infinite loop in PHP
-
-
oh man I never heard about that until now, this is amazing: http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/ …
2 replies 1 retweet 7 likes -
This is why it's so important for compilers to comply strictly to spec & not do foolish transformations that change results.
1 reply 0 retweets 0 likes -
this one's actually worse though: the compiler didn't even do any transformations
1 reply 0 retweets 1 like -
Replying to @FioraAeterna @RichFelker and
rather, x87 keeps extra internal precision between ops, and you *can't turn it off*
5 replies 0 retweets 2 likes -
There's a spec on this in C around FLT_EVAL_METHOD and it's 100% deterministic if implemented correctly. GCC does it wrong in -std=gnuXX.
1 reply 0 retweets 2 likes -
yes. what i mean is that doing the naive compilation will not match the spec; you have to do extra steps to match it
1 reply 0 retweets 0 likes -
Erm, if I understand it right you just implement double+double=double_t, flush those to stack, and only round when storing to double?
1 reply 0 retweets 0 likes -
Conforming compiler has to spill doubles as double_t (long double for x86), convert to double only via explicit cast or assignment.
3 replies 0 retweets 1 like -
Oh, so the only distinction from naive semantics is your register spill has to be different?
1 reply 0 retweets 0 likes
Yes, that's basically all. Assuming naive means no transformations you need to preclude.
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.