mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-27 18:24:27 +01:00
Change the fallback isinf() macro to NOT need f_zero defined
Delete old comments from before math.h was the default isinf() method
This commit is contained in:
@@ -225,11 +225,13 @@ typedef _US64 _U_SINT;
|
||||
typedef UNITY_FLOAT_TYPE _UF;
|
||||
|
||||
#ifndef isinf
|
||||
#define isinf(n) (((1.0f / f_zero) == n) ? 1 : 0) || (((-1.0f / f_zero) == n) ? 1 : 0)
|
||||
#define UNITY_FLOAT_NEEDS_ZERO
|
||||
/* The value of Inf - Inf is NaN */
|
||||
#define isinf(n) (isnan((n) - (n)) && !isnan(n))
|
||||
#endif
|
||||
|
||||
#ifndef isnan
|
||||
/* NaN is the only floating point value that does NOT equal itself.
|
||||
* Therefore if n != n, then it is NaN. */
|
||||
#define isnan(n) ((n != n) ? 1 : 0)
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user