[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #47741] The scanf family of functions cannot p
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #47741] The scanf family of functions cannot parse 64bit hex numbers on Windows and 32bit Linux |
Date: |
Tue, 26 Apr 2016 17:37:55 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:46.0) Gecko/20100101 Firefox/46.0 |
Follow-up Comment #7, bug #47741 (project octave):
I tried an mxe-build with your patch (and your patch for bug #47759) on
Windows 10 with the following results:
>> sscanf('3000000000', '%d')
ans = 2147483647
>> sscanf('3000000000', '%ld')
ans = 3000000000
>> sscanf('ffffffffffffffff', '%lx')
ans = 1.84467440737096e+019
So that issue seems to be resolved on Windows, too.
With those two patches the examples from comment #4 give
>> sscanf('1000000000', '%d')
ans = 1.0000e+009
>> class(ans)
ans = double
>> sscanf('3000000000', '%d')
ans = 2.1475e+009
>> class(ans)
ans = double
>> sscanf('6000000000', '%d')
ans = 2.1475e+009
>> class(ans)
ans = double
>> sscanf('6000000000', '%ld')
ans = 6.0000e+009
>> class(ans)
ans = double
>> sscanf('ffff', '%x')
ans = 65535
>> class(ans)
ans = double
>> sscanf('ffff', '%lx')
ans = 65535
>> class(ans)
ans = double
>> sscanf('6000000000 6000000000', '%ld %d')
ans =
6.0000e+009
2.1475e+009
>> class(ans)
ans = double
>> sscanf('6000000000 ffff', '%ld %lx')
ans =
6.0000e+009
6.5535e+004
>> class(ans)
ans = double
So the only remaining difference to Matlab is the class for conversions with
only "%l[oux]" that should be uint64 and for only "%l[di]" that should be
int64.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?47741>
_______________________________________________
Nachricht gesendet von/durch Savannah
http://savannah.gnu.org/