pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adam Lancaster <alancaster@preventsys.com>
To: pgsql-sql@postgresql.org
Subject: Possible rounding error of large float values?
Date: Tue, 17 Aug 2004 10:21:22 -0700
Message-ID: <8758F8D58219684FAB0239EE8967048A010807@calculon.preventsys.com> (raw)

When setting a float column to this value:

9223372036854775807

It gets selected out as:

9.22337203685478E18

Which appears to be rounded. When we cast it to numeric type we get:

9223372036854780000

Which also is rounded. It is still possible to find the row using the
original value

select * from <table> where <col> = 9223372036854775807

Is this expected behavior?


Thanks,
Adam

view thread (7+ messages)  latest in thread

Message-ID: <8758F8D58219684FAB0239EE8967048A010807@calculon.preventsys.com>
Permalink:  ../8758F8D58219684FAB0239EE8967048A010807@calculon.preventsys.com/
Also on:    postgresql.org/message-id/8758F8D58219684FAB0239EE8967048A010807@calculon.preventsys.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: alancaster@preventsys.com
  Subject: Re: Possible rounding error of large float values?
  In-Reply-To: <8758F8D58219684FAB0239EE8967048A010807@calculon.preventsys.com>

* 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