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

Jan Åge Langeland j-lan at online.no
Mon Aug 29 09:46:39 CEST 2016


On 29.08.2016 02:09, Tim Wescott wrote:
> A kludge would be to make it into two integers.

Each case may not be so complex to work around, but in total it seems 
like Scilab 6 is not yet well prepared for int64 and uint64.

For instance  %x and %o need to be handled too, functions like dec2bin() 
and dec2hex() should work - etc.

Generally a lot of caution is needed when using these 64 bit integers.  
Example:

--> int64(2^62+256+1) //loss of prescision
  ans  =
   4611686018427387904

--> int64(2^62)+256+1 //correct
  ans  =
   4611686018427388161

--> int64(2)^62+256+1 // correct
  ans  =
   4611686018427388161


Jan Å



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


More information about the users mailing list