Hello mohamed,

you wrote on Thu, 20 May 2021 13:07:57 +0000:

>    Your answer  deserves to be applied but my  firebird data fields
> to be sumed are either  integer  (16,32,64 bits)  or numeric (x,y).
> Numeric (x,y)  is compatible with  currency Var.

Right, Numeric is compatible with currency, and (probabely) also with
integer. But currency and integer are _not_ (directly) compatible,
because one is a "whole number" type (integer), and the other is a
_scaled_ number (currency, of course), which is lumped into the "real"
types by fpc. In fact, currency is a 64 bit integer shifted "down" by
(AFAIK) 4 decimal places, i.e. the integer value 10000 is equivalent
to a currency value of "1", which incidentally would be equivalent to
approximately a db numeric (20, 4) (20 digits w/ 4 decimal places).
What this means is that to add an integer to such a "numeric" value,
the integer value would have to be multiplied by 10000 first, whereas
a currency value could be added directly. Things change "a bit" for
numerics of other kinds, a (n, 3) numeric value, e.g., would require
a scaling factor of 1000 against an integer, but a factor of 0.1 (!)
aginst a currency value. These scaling operations are what makes the
data types incompatible and what requires special handling for
operations with the "numeric" db data type.
I hope I got that all (mostly) right and could state it understandably.

(BTW, all this has to be taken into account by a "variant" data type
value, of course, what is what makes variants very complicated to
handle and requires a lot of code to be implicitely added by the
compiler and linker.)

-- 
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
-----------------------------------------------------------
Mit freundlichen Grüßen, S. Schicktanz
-----------------------------------------------------------



_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to