1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

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.)
This commit is contained in:
Andrew Gierth
2019-02-13 19:35:50 +00:00
parent 711bab1e4d
commit da6520be7f
4 changed files with 39 additions and 34 deletions

View File

@ -1028,7 +1028,7 @@ double_to_shortest_decimal_bufn(double f, char *result)
/* Case distinction; exit early for the easy cases. */
if (ieeeExponent == ((1u << DOUBLE_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_64 v;

View File

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