Hannu Krosing wrote:
>
> Tom Lane wrote:
> >
> > "Frederick W. Reimer" <fwr@ga.prestige.net> writes:
> > > In general, it's recommended you don't check for exact equivalence when
> > > doing calculations on real numbers and instead check for "almost exactness."
> >
>
> perhaps "where trunc(85/0.0085) = 10000" works better.
ok I tested it and it does not work ;(
hannu=# select trunc(85.0::float4/0.0085::float4) = '10000';
ERROR: Function 'trunc(float4)' does not exist Unable to identify a function that satisfies the given argument
types You may need to add explicit typecasts
hannu=# select trunc(float8(85.0::float4/0.0085::float4));trunc
------- 9999
(1 row)
But this does work
hannu=# select text(85.0::float4/0.0085::float4) = '10000';?column?
----------t
(1 row)
As does this
hannu=# select round(float8(85.0::float4/0.0085::float4));round
-------10000
(1 row)
--------------
Hannu