[Scilab-users] How to print int64 or uint64 integers at full accuracy?

Jan-Åge Langeland (p) j-lan at online.no
Mon Aug 29 14:46:25 CEST 2016


Yes in terms of ratio that is a huge improvement :) , but having functions that fail when a number reach a certain size is a ticking bomb, for instance if you use them for timetagging. 
I agree also that the 2^62+256+1 is not directly a bug, but it may not be obvious everyone that a sum of integers shall be calulated via float aritmetics. 
Jan Å 


-------- Original message --------
From: Samuel Gougeon <

    
    Yes, but this loss is expected, since 2^62+256+1 is performed with
    decimal encoding.

    It is a case similar to the classical 1+ %eps/2

    It is not a bug.

    For dec2*(): int64 encoding is already supported, and a clear error
    message is yielded for input integers > 2^52

    

    --> dec2bin(int64(2^52))

     ans  =

     10000000000000000000000000000000000000000000000000000

    

    --> dec2bin(int64(2^53))

    at line    12 of function dec2bin (
      SCI\modules\elementary_functions\macros\dec2bin.sci line 43 )

    dec2base: Wrong value for input argument #1: Must be
      between 0 and 2^52.

    

    So, there is still a limitation, but it is clearly stated. At least,
    integers from 2^33 to 2^52 are newly supported :)

     

    Samuel


    

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


More information about the users mailing list