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

Rafael Guerra jrafaelbguerra at hotmail.com
Mon Aug 29 12:37:20 CEST 2016


(sorry, please consider corrected code below and discard previous)

From: Rafael Guerra
Sent: Monday, August 29, 2016 12:34 PM
To: Users mailing list for Scilab <users at lists.scilab.org>
Subject: RE: [Scilab-users] How to print int64 or uint64 integers at full accuracy?

Hello,

I have tried Tim's nice kludge but with no success.
A different attempt using "modulo" failed too:

i = int64(2)^62 + 1;
s = "";
j = i;
b = int64(10);
while (j >= 1)
    dj = modulo(j,b);
    s = s + string(dj);
    j = j/b;
end
s = strrev(s);
printf("64-bit integer - string: %s\n", s)
printf("64-bit integer - true:   4611686018427387905\n")


It is indeed puzzling and troublesome that a number can be correctly output to Scilab's console but not to a string or a file...
Cheers,
Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20160829/951dd481/attachment.htm>


More information about the users mailing list