Subject RE: [firebird-support] Using aritmetic operation with numeric fields in Firebird Alan McDonald 2006-09-11T09:45:02Z
> 20 significant digits is more than a 64 bit number, and multiplying two
> NUMERIC 15, 5 means the result must be NUMERIC 30, 10, something not
> even a 128-bit number would be able to!
>
> If you have this definition because you sometimes operate with large
> numbers and other times with small numbers (as opposed to all 20 digits
> being significant in some cases), then I guess you could try storing in
> two different fields, one for the value and one for the precision/offset
> (I don't quite know the name, neither in Norwegian, English, nor Russian).
>
> I don't know what to recommend you, just thought that since no-one has
> answered you for 17 hours, I could point out that you're dealing with
> really huge numbers. Firebird 1.5 cannot handle more than 64 bit
> numbers, and even though I don't know, I haven't heard those limits have
> changed with Firebird 2.0.
>
> Set

I was going to say - just use FLOAT and just cast your answers each time to
15,5 if that's what you really want.
I'm an odd man out here. I use FLOAT for everyting including currency. I
just cast the result the way I need it. I've never had an issue
Alan

>
> majstoru wrote:
> > Hi,
> >
> > I'm using Firebird 2 and I have a table with a few numeric field
> > which is set to NUMERIC 15, 5.
> > When I need to make sam SQL statement like SELECT NumField1 *
> > NumField2 (where is numeric fields are NUMERIC 15, 5) FROM Table
> > I get error "Integer overflow The result of an integer operation
> > caused the most significant bit of a result to query".
> >
> > I must have a Numeric number with a 5 decimal places, because of
> > better precision!
> > Is there another type of numeris which can I use for this operation
> > or some anoter solution, OR I'm wrong :-(!
> >
> > Thans for help to all Firebird members!
>