Re: Precision when substracting two values with SQL

From: Tim Ellis <Tim(dot)Ellis(at)gamet(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Precision when substracting two values with SQL
Date: 2002-08-12 20:24:07
Message-ID: 20020812132407.41c1b314.Tim.Ellis@gamet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> ciudadela=# select 0.2-0.2;
> 0
> ciudadela=# select 0.2-0.21;
> -0.00999999999999998
> ciudadela=# select 0.21-0.22;
> -0.01

I also get this on my Postgres 7.2.1, both Linux and Solaris.

--
Tim Ellis
Senior Database Architect
Gamet, Inc.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Larry Rosenman 2002-08-12 20:27:01 Re: Precision when substracting two values with SQL
Previous Message Juancho 2002-08-12 19:57:32 Precision when substracting two values with SQL