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:
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user