Just comments about math

From: Edipo Elder Fernandes de Melo <edipoelder(at)ig(dot)com(dot)br>
To: pgsql-sql(at)postgresql(dot)org
Subject: Just comments about math
Date: 2001-12-07 17:34:51
Message-ID: 200112071734.fB7HYsm91502@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)ig(dot)com(dot)br]

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message mcornell 2001-12-07 18:40:19 DISCTINCT and literals - Unable to identify an ordering operator
Previous Message Tom Lane 2001-12-07 17:11:46 Re: Vacuum analyze decreases speed