[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] Re: Re: How many years?
> But the computer doesn't knows that :-/
> I can't find a reference or explanation nor can deduce it myself.
>
> 0.33333333333333 * 3; // 0.99999999999999
> 0.33333333333334 * 3; // 1
> 0.33333333333335 * 3; // 0.0000000000001
> 0.333333333333333 * 3 // 1
>
> Is this a feature of the floating point representation?
> When one is one?
well, floating point numbers are not able to represent the number 1/3. [1]
may be interesting to read, as it describes some of the problems of using
floating-point math.
cheers, tim
[1] http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/