diff options
author | jcgollnick <jonathan.gollnick@gmail.com> | 2020-11-26 16:57:47 -0600 |
---|---|---|
committer | jcgollnick <jonathan.gollnick@gmail.com> | 2020-11-27 13:02:12 -0600 |
commit | 3347cc25b81fa89b0be0ab31269defcb86252a26 (patch) | |
tree | 25caf416480dc7aaa51f59e226d64a957981a2bc | |
parent | ed2f84735b0fe6b75c823716426d62e6b80e7ae3 (diff) |
Fix SGN macro
This version behaves the way the documentation states: 0 values will resolve to 0 instead of +1
-rw-r--r-- | core/typedefs.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/typedefs.h b/core/typedefs.h index d7ee5ee40e..7c98bc37f7 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -92,7 +92,7 @@ #endif #ifndef SGN -#define SGN(m_v) (((m_v) < 0) ? (-1.0) : (+1.0)) +#define SGN(m_v) (((m_v) == 0) ? (0.0) : (((m_v) < 0) ? (-1.0) : (+1.0))) #endif #ifndef MIN |