Search Postgresql Archives

Re: numeric precision when raising one numeric to another.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Dann Corbit" <DCorbit@xxxxxxxxx> writes:

> Probably, the important meaningful cases are ones that have small
> exponents (HOPEFULLY less than 25) used in interest calculations.

No, even in interest calculation floating point arithmetic is perfectly fine.
You do your floating point arithmetic to calculate the factor to use when
multiplying your fixed precision exact dollar amounts. You then store the
result again in exact form and do your account balancing in fixed precision
arithmetic to be sure you don't lose a penny here or there.

In fact the exponent can be much larger than 25 (think of monthly compounded
25 year mortgages, or worse, daily compounded savings accounts). But in those
cases the base will be very close to 1.

There's really no use case for NUMERIC^NUMERIC except in the case of an
integral power which is useful for number theory and cryptography.


-- 
greg


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux