[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Ruby doesn't know how to multiply

MenTaLguY

6/21/2007 7:50:00 PM

On Fri, 22 Jun 2007 04:40:29 +0900, "juan pedro meriño" <juapdiaz@gmail.com> wrote:
> You are rigth James, but you can better reponse why is a floating point
> error?

Not all numbers can be represented by an arbitrarily small number of digits, and floating-point numbers only have so many digits available (for Ruby, 53 binary digits, which is about 16 decimal digits). In this case, the computation required more than 53 bits, so the result was approximate.

-mental