[Scilab-users] Function int() strange behavior

Stéphane Mottelet stephane.mottelet at utc.fr
Mon Apr 18 08:57:38 CEST 2016


It seems to be the normal behavior, as int() and floor() behave the same 
for positive numbers (and 1.45 cannot be stored exactly with IEEE 754)

S.

Le 18/04/2016 08:17, ol.bond a écrit :
> Thank you Samuel, I got it also....
>
> 2016-04-18 15:13 GMT+09:00 Samuel GOUGEON [via Scilab / Xcos - Mailing 
> Lists Archives] <[hidden email] 
> </user/SendEmail.jtp?type=node&node=4033995&i=0>>:
>
>     Hello,
>
>     Le 18/04/2016 08:03, ol.bond a écrit :
>>     .../...
>>
>>     *but:*
>>
>>     int(1.45/0.025)
>>      ans  =
>>         57.
>>
>>     Can anyone explain what is going on?
>     .
>     --> 1.45/0.025 - 58
>      ans  =
>
>       -7.105D-15
>
>     is the round-off error
>     SG
>
>
>     _______________________________________________
>     users mailing list
>     [hidden email]
>     <http:///user/SendEmail.jtp?type=node&node=4033994&i=0>
>     http://lists.scilab.org/mailman/listinfo/users
>
>
>     ------------------------------------------------------------------------
>     If you reply to this email, your message will be added to the
>     discussion below:
>     http://mailinglists.scilab.org/Function-int-strange-behavior-tp4033993p4033994.html
>
>     To start a new topic under Scilab users - Mailing Lists Archives,
>     email [hidden email] </user/SendEmail.jtp?type=node&node=4033995&i=1>
>     To unsubscribe from Scilab users - Mailing Lists Archives, click here.
>     NAML
>     <http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
>
>
> ------------------------------------------------------------------------
> View this message in context: Re: Function int() strange behavior 
> <http://mailinglists.scilab.org/Function-int-strange-behavior-tp4033993p4033995.html>
> Sent from the Scilab users - Mailing Lists Archives mailing list 
> archive 
> <http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html> 
> at Nabble.com.
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users


-- 
Département de Génie Informatique
EA 4297 Transformations Intégrées de la Matière Renouvelable
Université de Technologie de Compiègne -  CS 60319
60203 Compiègne cedex

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


More information about the users mailing list