pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Strange results when casting string to double
Date: Thu, 17 Feb 2022 09:41:16 +0100
Message-ID: <59632509-6ead-bdaa-8ee4-035db22e530d@gmx.net> (raw)
In-Reply-To: <0d711ac6-6975-ae07-8963-aa91c6500776@datagis.com>
References: <0d711ac6-6975-ae07-8963-aa91c6500776@datagis.com>

Carsten Klein schrieb am 16.02.2022 um 14:27:
> I'm using several (now unsupported) PostgreSQL 9.3.24 servers on
> different (ancient) Ubuntu 14.04 LTS machines. On only one of those
> servers, I get strange/wrong results when converting a string into a
> double value:
>
> SELECT 1.56::double precision;
>
> --> 1.55999999999999   (wrong!)
>
> Although I do not find any differences in configuration, on all other servers the result looks like this (correct?):
>
> SELECT 1.56::double precision;
>
> --> 1.56               (correct!)
>

I wonder if extra_float_digits is different between those  systems
Maybe initialized by differently configured SQL clients.





view thread (24+ messages)  latest in thread

Message-ID: <59632509-6ead-bdaa-8ee4-035db22e530d@gmx.net>
Permalink:  ../59632509-6ead-bdaa-8ee4-035db22e530d@gmx.net/
Also on:    postgresql.org/message-id/59632509-6ead-bdaa-8ee4-035db22e530d@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: shammat@gmx.net
  Subject: Re: Strange results when casting string to double
  In-Reply-To: <59632509-6ead-bdaa-8ee4-035db22e530d@gmx.net>
  References: <0d711ac6-6975-ae07-8963-aa91c6500776@datagis.com> <59632509-6ead-bdaa-8ee4-035db22e530d@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox