Representation of floats



On 5/16/2012 1:05 AM, Evgeniy Maevskiy wrote:
> In floats (i.e. numer:true) we have:
>
> (%i1)
> (%o1) [0.2,0.04,0.008,0.0016,3.2000000000000003E-4,6.3999999999999997E-5,
> 1.2799999999999999E-5]
>
> but Firefox-javascript (for example) returns precise values:
>
> 0.2
> 0.04
> 0.008
> 0.0016
> 0.00032
>
>
No,  it is not representing values precisely.  It is just printing them
with fewer digits.

try fpprintprec:5; numer:true;

x:makelist(1/5^k,k,1,7);
[0.2,0.04,0.008,0.0016,3.2*10^-4,6.4*10^-5,1.28*10^-5]