Floating point numbers, was: Re: Digital



On 2012-07-16, Michael Kraemer <M.Kraemer@xxxxxx> wrote:
John Smith (who cares if I'm the one @ HP - if here's even still there)
schrieb:

Using floating point is probably fine if you are dealing with cash register
trnsactions of under a few hundred dollars/Euros. But trust me, hedge
funds/pension funds don't like being short-changed on deals of $250+ million
where the floating-point errors show up.

well, wouldn't double precision do the job?
16 decimal digits should be enough to express
even the US national debt, no?
And if this is not enough, modern C/C++
supports long double (128bit) as well.


Have you done any accounting work ?

The problem is that a floating point number is a approximation. This does
not matter in many scientific/technical problem domains but it does matter
in accounting. When it comes to accounting you want to represent numbers
in a format which is _guaranteed_ to be exact.

The usual candidate is some form of fixed point representation.

Simon.

--
Simon Clubley, clubley@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Microsoft: Bringing you 1980s technology to a 21st century world
.



Relevant Pages

  • Re: Floating point numbers, was: Re: Digital
    ... does not matter in many scientific/technical problem domains but it ... does matter in accounting. ... When it comes to accounting you want to ... the result so that 0.5 or greater of a penny rounds up to the next one. ...
    (comp.os.vms)
  • Re: Floating point numbers, was: Re: Digital
    ... not matter in many scientific/technical problem domains but it does matter ... When it comes to accounting you want to represent numbers ... 32 bit unsigned format, which was more than enough range for the application. ...
    (comp.os.vms)
  • Re: Floating point numbers, was: Re: Digital
    ... Simon Clubley schrieb: ... not matter in many scientific/technical problem domains but it does matter ... When it comes to accounting you want to represent numbers ...
    (comp.os.vms)