Decimal arithmetic, with example code

Dennis Lee Bieber wlfraed at ix.netcom.com
Wed Oct 2 01:02:12 EDT 2002


Chris Gonnerman fed this fish to the penguins on Tuesday 01 October 
2002 06:43 pm:


> 
> Perhaps I misunderstood.  Am I supposed to use higher
> precision and then lower it after computation?
>
        Well, that /is/ how the M$ VB6 "currency" type does -- it maintains 4 
decimal places (using 64bit scaled integer arithmetic), and likely 
expect the programmer to specify a display string with only two 
decimals.


        I wouldn't be surprised to find that many COBOL programs may be using 
extra digits internally.

--
 > ============================================================== <
 >   wlfraed at ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed at dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >        Bestiaria Home Page: http://www.beastie.dm.net/         <
 >            Home Page: http://www.dm.net/~wulfraed/             <



More information about the Python-list mailing list