A DECFLOAT(16) is a 64-bit IEEE 754 decimal64, and a DECFLOAT(34) is a
128-bit IEEE 754 decimal128. Firebird itself uses the decNumber library
to manipulate them. See
http://speleotrove.com/decimal/#decNumber for
this library. Firebird includes this code in extern/decnumber. See also
the code in src/common/DecFloat.cpp which defines the operations
Firebird supports on decfloat (using decNumber).
For example, obtaining a decimal128 from string is done with
decQuadFromString, conversion to string with decQuadToString, addition
is decQuadAdd, etc.
I don't know the Go ecosystem well enough to say if there is a Go
library that supports decimal64 and decimal128 manipulation, but I
believe you should be able to bind that decNumber library in Go.
Alternatively, if you want them as string, you could use the
isc_dpb_set_bind connection property or the SET BIND statement to define
a mapping to string, so Firebird coerces the data types to/from string
when sending to or receiving from the client. This can be done by
setting isc_dpb_set_bind to "decfloat to varchar", or by executing
set bind of decfloat to varchar;
You could also bind to - for example - double precision, but then you
lose precision and range.
Mark
--
Mark Rotteveel