Just comments about math - Mailing list pgsql-sql

From Edipo Elder Fernandes de Melo
Subject Just comments about math
Date
Msg-id 200112071734.fB7HYsm91502@postgresql.org
Whole thread Raw
Responses Re: Just comments about math
List pgsql-sql
Hi all, 
   Why the results below are different? (On my casio scientific calculator, 
the two expressions below are equals to 381.4) 

=# select (3+0.2*707/80)*80; ?column? 
----------    381.4 

=# SELECT 80*(3+(707/80)*0.2); ?column? 
----------      368 
   Answer: "select 707/80;" returns 8, while "select 707/80::float" returns 
8.8375. 
   Abracos, 
   Edipo Elder    [edipoelder@ig.com.br] 

_________________________________________________________
Oi! Voc� quer um iG-mail gratuito?
Ent�o clique aqui: http://registro.ig.com.br/



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Vacuum analyze decreases speed
Next
From: Bruce Momjian
Date:
Subject: Re: Trigger for logging stuff...