[Info-ingres] precision
Roy Hann
roy.hann at rationalcommerce.com
Thu Nov 15 13:36:33 UTC 2018
Thursday, November 15, 2018, 1:04:27 PM, you wrote:
> Today I was surprised by a simple bit of Ingres maths.
[snip]
> select batch_no, count(*), sum(source_amount) from testsum
> group by batch_no
> having abs(sum(source_amount)) >= 0.01;
FLOATs are fuzzy. 0.01 above is implicitly DECIMAL. If you use
...having abs(sum(source_amount)) >= float4(0.01)
instead, it probably works as you hoped.
Roy Hann
Rational Commerce Ltd.
T +44 20 8691 2089
"Ingres development, tuning and training experts"
More information about the Info-ingres
mailing list