[Scilab-users] Floating-point relative accuracy – HELP

Samuel Gougeon sgougeon at free.fr
Thu Dec 14 23:15:10 CET 2017


Hello,

Le 14/12/2017 à 21:54, David Brant a écrit :
> Hello
>
> I'm not fully conversant with Matlab, but offered to help my daughter
> with a tutorial in Scilab ... and then Matlab!
>
> Basically Matlab gives the 'expected' tutorial answer (n=17), and scilab
> does not! Hopefully this is down to my lack of expertise, but i would
> very much like understand why.
>
> Does the problem require the use of floating-point relative accuracy
> feature (%eps)?

Yes. The stopping test is

if  dif/S  <=  %eps break end

This stops at n=17 as well.

Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20171214/62395670/attachment.htm>


More information about the users mailing list