Re: Strange results when casting string to double - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: Strange results when casting string to double
Date
Msg-id f3575aaf-98a8-6941-7843-ba1a0d78514f@enterprisedb.com
Whole thread Raw
In response to Strange results when casting string to double  (Carsten Klein <c.klein@datagis.com>)
Responses Re: Strange results when casting string to double  (Carsten Klein <c.klein@datagis.com>)
List pgsql-general
On 16.02.22 14:27, Carsten Klein wrote:
> AFAIK, this conversion is done by internal function float8in, which, 
> when called directly, yields the same results:
> 
> SELECT float8in('1.56');
> 
> --> 1.55999999999999   (wrong!)   on one server, and
> --> 1.56               (correct!) on all other servers.

float8in() really just calls the operating system's strtod() function. 
I would test that one directly with a small C program.

It's also possible that different compiler options lead to different 
optimizations.



pgsql-general by date:

Previous
From: Michael Lewis
Date:
Subject: Re: PostgreSQL's Max Identifier Length in Amazon RDS
Next
From: Mladen Gogala
Date:
Subject: Re: 2 phase commit with FDW