On 13 Nov 2014, at 1:01pm, Dinesh Navsupe <dinesh.navs...@gmail.com> wrote:

> My need is 23 decimal digits of precision. We work on complex payout
> calculation engine where in formula outputs are quite large numbers and
> clients do not want to round off.

If you're working with floating-point numbers, you will get roundoff [1].  
Integer arithmetic really is how big banks work.  That way you don't have to 
test for rounding problems and never get accused of Salami Slicing.  If you 
really need money precision you'll be working in integers representing paise, 
pennies, halalas, whatever.  You'd have asked for 23 digit integers, not 23,10.

Since the abandonment of the Lira, no decimal country currency has needed 
anything more than three places of decimals for manipulation.  So for 23 digits 
of accuracy you seem to have a requirement to manipulate

100,000,000,000,000,000,000

units of currency with perfect accuracy.  Even the World Bank Group doesn't 
need that.  And I don't think the total wealth of any country in its own 
currency requires that many digits. 

I've worked with international financial organisations and we never did 
anything that needed 23 digits of precision, and that includes complicated 
cumulative interest calculations and those unbelievable asset value predictions 
that require integration and antilogs.

In summary, if you need ultimate precision, use integers.  If not, use 64-bit 
IEEE-571 like everyone else does without being sued.  If you somehow really 
need 23,10 maths, then you're going to have to write your own mathematical 
library anyway, because I'm not aware of any usable libraries which actually 
support 23,10 outside the world of physics.

Simon.

[1] This is a little hand-waving but only a little.  I'm only mentioning that 
because I don't want someone in the industry to dig this up and use it against 
me.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to