Re: Fractional Results - Mailing list pgsql-sql

From Tom Lane
Subject Re: Fractional Results
Date
Msg-id 14772.1012624755@sss.pgh.pa.us
Whole thread Raw
In response to Fractional Results  (pocm@rnl.ist.utl.pt (Paulo J. Matos))
List pgsql-sql
pocm@rnl.ist.utl.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


pgsql-sql by date:

Previous
From: pocm@rnl.ist.utl.pt (Paulo J. Matos)
Date:
Subject: Fractional Results
Next
From: "A. Van Hook"
Date:
Subject: casting question