On fixed point numbers, it was said that:
> Essentially, this should be implemented simply as an integer, with an
> automatic scale on the IO routines.
>
> Alternatively, simply use an integer, and do the scaling in your
> middleware! ;)
Just to keep people from stumbling, I'd like to add:
This is good advice, as long as the only calculations done on the
integers *as integers* (e.g. in a SELECT expression) are + and -
operations. It will wonderfully fail for "<fixed> * <fixed>" or
"<fixed> / <fixed>"; these operations need to know about the implied
scaling.
It is ok to do "<int> * <fixed>", "<fixed> / <int>" etc.
Tobias
Personal Statement:
I like the idea of fixed point numbers as the underlying data type for
DECIMAL(m,n) [or was it NUMERIC?], maybe even a BCD type.
I'm not much of a business man, but even I wouldn't like my bank to
arbitrarily toggle the last digits of my bank account and explain that
with floating point anomalies caused by the exact sequence of my earning
and spending money. (I can almost see them telling me I should never
look for exact equality in an account balance, but rather use some
appropriate Epsilon! :-)
--
.............................................
(_) Tobias Rischer
"===' tobias@stripped
" "
...still.loving.gnu..........................