Re: Double: 2 Decimal points




"tex" <NoSpam@xxxxxxxxxxx> wrote in message
news:OgTFe.9423$dU3.341@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Just for what it's worth:
>
> Some year ago I took the trouble of finding some examples, and
> IBM's mainframe floating point encoding technique did not hold
> 0.10, so, say adding 100 dimes give you $9.99 (of course rounding
> would take care of it, but not if you added enough of it, say for a
> bank with 10s or 100s of thousands of customers, and large numbers
> of transactions.
>
> Today computers, including IBM mainframes I believe, use IEEE
> floating point, and I have not bothered to find some examples, but
> it is still true that not all decimals are represented by floating
> point
> vars.

Slightly off topic, but on mainframes financial applications tend to
use fixed point decimals. This does avoid the rounding errors in
adding and subtracting, but you pay for it by having a worse rounding
error with multiplication and division, so as far as I know it is not
a rational choice, just a traditional one.


.



Relevant Pages

  • Re: how do I get more numbers past the decimal?
    ... Doug Miller wrote: ... A floating point number is stored on a 32 bit machine using the 24 bit for the mantissa and its sign and 8 bits for the exponent and its sign. ... The IBM System/360 and 370 mainframes were 32-bit machines, yet they supported both 32- and 64-bit floating point numbers. ...
    (comp.lang.php)
  • Re: Precision
    ... There is nothing wrong with the D3 floating point algorithm or anyone else's ... It's the same if we use Precision, floating point, or ... positions it is IMPOSIBLE to have a result of 4 decimals with the 2 ... remember what the associated actuarial calculations were. ...
    (comp.databases.pick)
  • Re: Precision
    ... There is nothing wrong with the D3 floating point algorithm or anyone else's ... It's the same if we use Precision, floating point, or ... positions it is IMPOSIBLE to have a result of 4 decimals with the 2 ... remember what the associated actuarial calculations were. ...
    (comp.databases.pick)
  • RE: Packed decimal arithmetic in C
    ... >many decimals to ... >> I once used double precision floating point in exactly that manner. ... >applications that track currency and need to do so exactly. ... >A scaled integer meets the requirement of exactness. ...
    (comp.os.vms)
  • Re: Precision
    ... Whether one does the subsequent calculations in internal ie integer format ... I have always used external format with Precision 4 since my ... floating point calcs which are done in binary have around 3% error albeit at ... positions it is IMPOSIBLE to have a result of 4 decimals with the 2 ...
    (comp.databases.pick)