Subject | Re: Double precision field problem |
---|---|
Author | Adam |
Post date | 2006-10-30T22:32:15Z |
--- In firebird-support@yahoogroups.com, "ibrahim bulut" <i.bulut@...>
wrote:
This behaviour is perfectly normal for the datatype you are using. The
problem is you are expecting numeric behaviour.
Read the following article:
http://en.wikipedia.org/wiki/Floating_point
Particularly point 9 (4 is also useful).
Adam
wrote:
>Double Precision is a floating point style number type, not a numeric.
>
>
> i am in trouble double precision field with subtract operation
>
>
>
> field1 is double precision
>
> field2 is double precision
>
>
>
> field1's value is 79.69
>
> field2's value is 78.12
>
>
>
> when i subtract field2 from field1 with this sql statement
>
> select field1 - field2 from table1
>
> the result is 1,56999999999999
>
>
>
> the result must be 1,57
>
>
>
> what is the problem
This behaviour is perfectly normal for the datatype you are using. The
problem is you are expecting numeric behaviour.
Read the following article:
http://en.wikipedia.org/wiki/Floating_point
Particularly point 9 (4 is also useful).
Adam