Re: Fractional Results

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pocm(at)rnl(dot)ist(dot)utl(dot)pt (Paulo J(dot) Matos)
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Fractional Results
Date: 2002-02-02 04:39:15
Message-ID: 14772.1012624755@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

pocm(at)rnl(dot)ist(dot)utl(dot)pt (Paulo J. Matos) writes:
> After some testing i found out that temp1.espl / temp2.iluminados
> gives us always the floor of the real value.

If these are integers, try casting them to floats before dividing.
Integer division is generally understood to yield the floor().

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message A. Van Hook 2002-02-02 15:20:38 casting question
Previous Message Paulo J. Matos 2002-02-02 01:26:57 Fractional Results