[Bugzilla] [Bug 15505] New: Trouble with int64() around int64(%inf)-

bugzilla.admin at scilab.org bugzilla.admin at scilab.org
Sun Mar 25 20:35:38 CEST 2018


http://bugzilla.scilab.org/show_bug.cgi?id=15505
--------- Bug Summary -----------
Trouble with int64() around int64(%inf)-

---------- Changed by ------------
sgougeon at free.fr

---------- What changed ----------
bug_id, short_desc, product, version, rep_platform, op_sys, bug_status, bug_severity, priority, component, assigned_to, reporter


            Bug ID: 15505
           Summary: Trouble with int64() around int64(%inf)-
           Product: Scilab software
           Version: 6.0.1
          Hardware: (not used)
                OS: All OS
            Status: NEW
          Severity: Minor
          Priority: (field not used)
         Component: Numerical Math
          Assignee: bugzilla.admin at scilab.org
          Reporter: sgougeon at free.fr

BUG DESCRIPTION:
----------------

--> imax = int64(%inf)
 imax  = 
  9223372036854775807

--> x = 2^63-1;
--> x <= imax
 ans  =
  T

--> int64(x)
 ans  =
 -9223372036854775808   <<<< Should be imax, not wrapped, since <= imax(int64)!

It's OK for the floor:
---------------------
--> imin = int64(-%inf)
 imin  = 
 -9223372036854775808

--> x=-(2^63)
 x  = 
  -9.223D+18

--> x >= imin
 ans  =
  T

--> int64(x)
 ans  =
 -9223372036854775808     <<<< OK: not wrapped


There is some trouble with uint64() as well around uint64(%inf), but distinct => reported apart.

ERROR LOG:
----------
none. wrong behavior

HOW TO REPRODUCE THE BUG:
-------------------------
imax = int64(%inf)
x = 2^63-1;
x <= imax
int64(x)==imax   // %F == The bug

// The following is OK and should remain so:
imin = int64(-%inf)
x = -(2^63)
x >= imin
int64(x)==imin


OTHER INFORMATION:
------------------
This bug has complicated a lot the design of the unit tests
test_run compatibility_functions mtlb_int_uint

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/bugzilla/attachments/20180325/b95465d4/attachment.htm>


More information about the Bugzilla mailing list