[Scilab-users] linearly spaced vector

Rafael Guera jrafaelbguerra at hotmail.com
Sun Sep 6 13:24:50 CEST 2015


Hello,

The error magnitude seems to smaller than the default machine precision for Scilab double floating numbers (%eps = 2.220D-16) .

There are some Scilab packages for arbitrary precision (MPScilab, MPAT, Xnum,...), you may want to check them out.

Regards,
Rafael

-----Original Message-----
From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of fujimoto2005
Sent: Sunday, September 06, 2015 8:16 AM
To: users at lists.scilab.org
Subject: [Scilab-users] linearly spaced vector

I expected the following script to generate linearly spaced vectors x1,x2 and
x3 with step 0.01.
But x1(3),x2(2) and x3(15) are slightly different values from expected
values.
This phenomena happens with both Scila5.5.2 and Scilab 6.0.0 alpha.
Is there any ways to get exactly expected values?

********************
min=0.04;
low=0.098;
high=0.2;
x1=[ceil(low*100)/100:0.01:floor(high*100)/100]
disp(x1(3)-0.12);
x2=[floor(low*100)/100:0.01:high]
disp(x2(2)-0.1);
x3=[floor(min*100)/100:0.01:high]
disp(x3(15)-0.18);
******************
Best regards



--
View this message in context: http://mailinglists.scilab.org/linearly-spaced-vector-tp4032794.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
users at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




More information about the users mailing list