[Scilab-users] scilab 5.4.1 simple calculations need rounding

Lester Anderson arctica1963 at gmail.com
Sun Sep 15 18:57:11 CEST 2013


Hello,

I have Scilab 5.4.1 and tried the code as you typed it and I get no
rounding errors:

-->x=poly(0,'x')
 x  =

    x

-->f=(x-1)^2
 f  =

              2
    1 - 2x + x

-->factors(f)
 ans  =


       ans(1)

  - 1 + x

       ans(2)

  - 1 + x

-->roots(f)
 ans  =

    1.
    1.

Maybe some others can see what the issue is. Running on Windows 7 64 bit.

Cheers
Lester


On 15 September 2013 13:44, Manjusha Joshi <manjusha.joshi at gmail.com> wrote:

>
>
> -->x=poly(0,'x')
>  x  =
>
>     x
>
> Hello,
>
> I am defining polynomial in one variable
>
> -->f=(x-1)^2
>  f  =
>
>               2
>     1 - 2x + x
>
> I want to find factors and roots, which I can see easily as (x-1) (x-1)
> and roots are 1 1
>
> How ever when I tried the command
>
>
> -->factors(f)
>  ans  =
>
>
>        ans(1)
>
>   - 0.99999999999999989 + x
>
>        ans(2)
>
>   - 0.99999999999999989 + x
>
> -->roots(f)
>  ans  =
>
>     0.99999999999999989
>     0.99999999999999989
>
> -->round(roots(f))
>  ans  =
>
>     1.
>     1.
>
>
> After rounding roots I am getting the correct answer.
>
> In earlier scilab version it was working with our rounding.
>
> Is it a bug?
>
> Looking forward for response.
>
> Regards,
>
> --
> Manjusha S. Joshi
> Pune, India
> blog:http://manjushajoshi.wordpress.com/
>
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130915/ef6c6aee/attachment.htm>


More information about the users mailing list