Subject | RE: [ib-support] newbie question : NUMERIC and DECIMAL type difference |
---|---|
Author | Alan McDonald |
Post date | 2003-02-20T22:11:07Z |
I'll add another alternative..
I use F_FIXEDPOINT to retrieve to the desired scale
Alan
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Friday, 21 February 2003 8:53 AM
To: ib-support@yahoogroups.com
Subject: RE: [ib-support] newbie question : NUMERIC and DECIMAL type
difference
At 02:05 PM 20/02/2003 -0500, you wrote:
fixed types for things you count.
It is documented that DECIMAL stores only numbers of exactly the scale
specified, while NUMERIC stores numbers of at least the scale
specified. But, really, DECIMAL and NUMERIC seem the same to me. That
is, both seem to overflow when given numbers of larger than the specified
scale. I think there might have been a difference when InterBase stored
numbers as 32-bit integers.
If I have a rule of thumb about scaled numerics, it is to use either
numeric or decimal and make sure I store a big enough scale to accommodate
the results of any multiplications or divisions.
Sorry I can't help with any enlightenment on BigDecimal though. If you
still don't have a satisfactory answer, I recommend asking directly on the
Jaybird list (firebird-java@yahoogroups.com)
heLen
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
I use F_FIXEDPOINT to retrieve to the desired scale
Alan
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Friday, 21 February 2003 8:53 AM
To: ib-support@yahoogroups.com
Subject: RE: [ib-support] newbie question : NUMERIC and DECIMAL type
difference
At 02:05 PM 20/02/2003 -0500, you wrote:
>Ann and/or Helen (I think Helen gives credit forActually, the mantra is "Use floating types for things you measure and
>it to Ann) stated a rule of
>thumb to use DECIMAL for things you "measure" and NUMERIC for things you
>"count".
fixed types for things you count.
It is documented that DECIMAL stores only numbers of exactly the scale
specified, while NUMERIC stores numbers of at least the scale
specified. But, really, DECIMAL and NUMERIC seem the same to me. That
is, both seem to overflow when given numbers of larger than the specified
scale. I think there might have been a difference when InterBase stored
numbers as 32-bit integers.
If I have a rule of thumb about scaled numerics, it is to use either
numeric or decimal and make sure I store a big enough scale to accommodate
the results of any multiplications or divisions.
Sorry I can't help with any enlightenment on BigDecimal though. If you
still don't have a satisfactory answer, I recommend asking directly on the
Jaybird list (firebird-java@yahoogroups.com)
heLen
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/