1
0
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:
jsalling
2016-08-27 15:27:52 -05:00
parent 028ca953d7
commit 54aa838c8a
2 changed files with 4 additions and 14 deletions

View File

@@ -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