From: terje.mathisen@tmsw.no   
      
   John Levine wrote:   
   > According to Thomas Koenig :   
   >>> Agreed, except IEEE has both binary and decimal flavors.   
   >>   
   >> And two decimal flavors, as well, with binary and densely packed   
   >> decimal encoding of the significand... it's a bit of a mess.   
   >>   
   >> IBM does the arithmetic in hardware, their decimal arithmetic probably   
   >> goes back to their adding and multiplying punches, far before computers.   
   >   
   > S/360 had packed decimal and zSeries even has vector ops for it. But it's   
   > different from DFP. Somewhere I saw a set of slides that said that the   
   > first DFP in z was done in millicode, with hardware later.   
   >   
   >>> It's never been   
   >>> clear to me how much people use decimal FP. The use case is clear enough,   
   >>> it lets you control normalization so you can control the decimal precision   
   ...   
   >   
   >> Speed? At least when using 128-bit densely packed decimal encoding   
   >> on IBM machines, it is possible to get speed which is probably   
   >> not attainable by software ...   
   >   
   > Software implmentations of DFP would be slow, but if you know what you are   
   > doing you can get the correctly rounded declmal results using BFP which I   
   > would think would be faster.   
   >   
   >> but still want to do the same applications. IIRC, everybody but   
   >> IBM uses binary encoding of the significand and software, probably   
   >> doing something similar to what you did.   
   >   
   > I used regular IEEE binary FP, with explicit code to do decimal rounding   
   > when needed. Like I said it was a pain but it wasn't all that hard.   
      
   I did the same around 1983/84, using Borland's Turbo Pascal. I started   
   PC programming in 1982 to solve a problem for my father-in-law to be.   
      
   I had to adhere to Norwegian legal accounting rules, so all the rounding   
   had to be correct, but like you I found that with the total precision   
   available and the known maximum number of operations before I had to do   
   the final rounding, just a small epsilon added was enough to guarantee   
   that the result would be OK.   
      
   Terje   
      
   --   
   -    
   "almost all programming can be viewed as an exercise in caching"   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|