From da6520be7f946f5f0f8fe46c34e303d1d36ee080 Mon Sep 17 00:00:00 2001 From: Andrew Gierth Date: Wed, 13 Feb 2019 19:35:50 +0000 Subject: More float test and portability fixes. Avoid assuming exact results in tstypes test; some platforms vary. (per buildfarm members eulachon, danio, lapwing) Avoid dubious usage (inherited from upstream) of bool parameters to copy_special_str, to see if this fixes the mac/ppc failures (per buildfarm members prariedog and locust). (Isolated test programs on a ppc mac don't seem to show any other cause that would explain them.) --- src/common/f2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/f2s.c') diff --git a/src/common/f2s.c b/src/common/f2s.c index 62432a539e7..ff22b56c926 100644 --- a/src/common/f2s.c +++ b/src/common/f2s.c @@ -756,7 +756,7 @@ float_to_shortest_decimal_bufn(float f, char *result) /* Case distinction; exit early for the easy cases. */ if (ieeeExponent == ((1u << FLOAT_EXPONENT_BITS) - 1u) || (ieeeExponent == 0 && ieeeMantissa == 0)) { - return copy_special_str(result, ieeeSign, ieeeExponent, ieeeMantissa); + return copy_special_str(result, ieeeSign, (ieeeExponent != 0), (ieeeMantissa != 0)); } floating_decimal_32 v; -- cgit v1.2.3