Remove dependency on libm#33
Conversation
|
Thanks a bunch. This looks got to merge, but it'll have to wait a bit longer because I want to make sure this won't break something, but I don't have the time to do that just now. |
| #define GOT_A_SCALE_MATRIX 0x080 | ||
|
|
||
| /* macros */ | ||
| #define ABS(x) ((x) > 0 ? (x) : -(x)) |
There was a problem hiding this comment.
To match the semantics of the glibc implemntation this should be ((x) >= 0 ? (x) : -(x)).
See: https://github.com/lattera/glibc/blob/master/stdlib/abs.c
As it's written, this would introduce -0 floating point values which might cause issues or changes in behavior.
There was a problem hiding this comment.
Interesting question. When in doubt, following the glibc implementation is probably the right choice.
So I updated the PR this way.
There was a problem hiding this comment.
Aaand there IS difference between (x < 0 ? -x : x) and (x >= 0 ? x : -x). The former won't change the sign of a quiet NAN, the latter will :)
I'm just wondering if we could remove the dependency on libm.
Just a few changes to do this, but I could be wrong.