mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-25 01:11:36 +01:00
Stopped supported -0 as a float output because (a) it is non-portable, only existing on some architectures and (b) relies on the undefined behavior of 1.0/0.0
This commit is contained in:
@@ -429,14 +429,14 @@ void UnityPrintFloat(const UNITY_DOUBLE input_number)
|
||||
UNITY_DOUBLE number = input_number;
|
||||
|
||||
/* print minus sign (including for negative zero) */
|
||||
if ((number < 0.0f) || ((number == 0.0f) && ((1.0f / number) < 0.0f)))
|
||||
if (number < 0.0f)
|
||||
{
|
||||
UNITY_OUTPUT_CHAR('-');
|
||||
number = -number;
|
||||
}
|
||||
|
||||
/* handle zero, NaN, and +/- infinity */
|
||||
if (number == 0.0f)
|
||||
if (number == 0.0f)
|
||||
{
|
||||
UnityPrint("0");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user