Subject rounding error in computed expression in query
Author vincent_kwinsey
I have the following test case (all mentioned fields are defined as
double precision), the results are the same in both cases - when the
same fdb file is accessed by Interbase 6.0.1 or Firebird 1.5.3 server
service:

select field1, field2, field1-field2 from fact_table
====
154,59 153.64 0.949999999999932

I expected 0.95 in the last column... So - there is no problem when
this result set is shown on GUI (whatever), but it is hard to decide
what to do when the result of query is assigned to some other variable
(in SP or trigger, e.g.) - should I make non-clean code and put
rounding in every place or it is possible to choose more appropriate
datatype to avoid this? Anyway numeric(...,...) is using double
precision.

I have heard about some bug in some processors' FPU, can this be
attributed to this strange behavior?