Re: Proposal for resolving casting issues - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal for resolving casting issues
Date
Msg-id 26667.1032452545@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal for resolving casting issues  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
List pgsql-hackers
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:
> For above calculation pg will in the future return 0.00000000000000000000 as an
> answer to 1.00000000000001*1000.0-1000.0 when used in my example context, while
> it currently returns 0.000000000010 ... 
> You both are saying, that 0.00000000000000000000 is a better answer. 

Not exactly: we are saying it is not a worse answer.  There's no reason
to prefer one over the other, because they are both within the range
of uncertainty given the inherent uncertainty in the float4 input.

If you want exact results, you should be using exact datatypes.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Memory Errors...
Next
From: "Marc G. Fournier"
Date:
Subject: SIMILAR TO syntax (Was: Re: The TODO List (Was: Re: O...)