My answer to "implement fabs(), incorrectly". Seven and one third internet points to anyone who can say why it's incorrect, without looking up the spec. Hint: It's implementation defined. (Using C99 semantics because that's the only one I know reasonably well. :)https://twitter.com/oe1cxw/status/1144274172253822976 …
-
-
Replying to @oe1cxw
There exists a representation of a negative double whose negation is also negative, i.e. a < 0 && -a < 0 holds true? I'm completely out of my depth.
1 reply 0 retweets 1 like -
Replying to @der_ak
No. That's only possible with twos-complement integers. But you are very close.
1 reply 0 retweets 0 likes -
-FLT_MIN is undefined? (only guessing, I think -INT_MIN was in any case..?)
1 reply 0 retweets 0 likes
Replying to @vegard_no @der_ak
-INT_MIN = INT_MAX+1 = INT_MIN because in twos complement there's one more negative number than there are positive numbers. FLT_MIN is simply the smallest positive normalized float. There's no issue with -FLT_MIN afaik. Just the same number with sign bit flipped.
1:47 AM - 28 Jun 2019
0 replies
0 retweets
1 like
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.