1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-26 09:51:36 +01:00

Update change log and known issues.

Fix bug with infinity and NaN handling.
This commit is contained in:
Mark VanderVoord
2023-11-13 17:03:07 -05:00
parent 3f7564ea3b
commit a1b1600e43
6 changed files with 154 additions and 24 deletions

View File

@@ -241,16 +241,25 @@
#endif
typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
/* isinf & isnan macros should be provided by math.h */
#ifndef isinf
/* The value of Inf - Inf is NaN */
#define isinf(n) (isnan((n) - (n)) && !isnan(n))
#endif
/* isnan macro should be provided by math.h. Override if not macro */
#ifndef UNITY_IS_NAN
#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)
#define UNITY_IS_NAN(n) ((n != n) ? 1 : 0)
#else
#define UNITY_IS_NAN(n) isnan(n)
#endif
#endif
/* isinf macro should be provided by math.h. Override if not macro */
#ifndef UNITY_IS_INF
#ifndef isinf
/* The value of Inf - Inf is NaN */
#define UNITY_IS_INF(n) (UNITY_IS_NAN((n) - (n)) && !UNITY_IS_NAN(n))
#else
#define UNITY_IS_INF(n) isinf(n)
#endif
#endif
#endif