[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [f-cpu] Re: Floating-Point?




> 
> > Ah, I have the same opinion about this theme. You don't really
> > need a higher precision than 64 bit. Maybe that will change for
> > galaxy navigation in the future but until now 32 bit are good
> > (and fast) for most cases.
> 
> Actually, floating-point is too imprecise for ANY precision 
> calculation. There are lots of numbers that can't be encoded 
> into floating-point values.
> 
> The bits in the mantissa are encoded as follows, for example:
> - bit 0: 1/2: 0.5
> - bit 1: 1/4: 0.25
> - bit 2: 1/8: 0.125
> - bit 3: 1/16: 0.0625
> 
> and so on. By setting the bits, you're adding up the fractions.
> 
> So, for example with financial computing, floating-point is a 
> big no-no, otherwise you end up with respresentation and rounding 
> errors.

I've spent the last 7 years writing financial applications, and have NEVER
seen or heard of BCD arithmetic being used. I always use 64-bit
representation mostly because it is most standard. Yes, you will get
rounding errors but you need a heck of a lot of calculations for the
rounding errors in the 16'th decimal place to add up to anything of any
significance.

Hans
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/