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 …
No. That's only possible with twos-complement integers. But you are very close.
-
-
-FLT_MIN is undefined? (only guessing, I think -INT_MIN was in any case..?)
-
-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.
End of conversation
New conversation -
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.