[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: |
Thu, 21 Apr 2016 08:10:48 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:46.0) Gecko/20100101 Firefox/46.0 |
Follow-up Comment #4, bug #47741 (project octave):
Some examples in Matlab on Windows:
>> sscanf('1000000000', '%d')
ans =
1.0000e+09
>> class(ans)
ans =
double
>> sscanf('3000000000', '%d')
ans =
2.1475e+09
>> class(ans)
ans =
double
>> sscanf('6000000000', '%d')
ans =
2.1475e+09
>> class(ans)
ans =
double
>> sscanf('6000000000', '%ld')
ans =
6000000000
>> class(ans)
ans =
int64
>> sscanf('ffff', '%x')
ans =
65535
>> class(ans)
ans =
double
>> sscanf('ffff', '%lx')
ans =
65535
>> class(ans)
ans =
uint64
>> sscanf('6000000000 6000000000', '%ld %d')
ans =
1.0e+09 *
6.0000
2.1475
>> class(ans)
ans =
double
>> sscanf('6000000000 ffff', '%ld %lx')
ans =
1.0e+09 *
6.0000
0.0001
>> class(ans)
ans =
double
The same in Octave 4.0.1 on Windows:
>> sscanf('1000000000', '%d')
ans = 1.0000e+009
>> class(ans)
ans = double
>> sscanf('3000000000', '%d')
ans = [](0x1)
>> class(ans)
ans = double
>> sscanf('6000000000', '%d')
ans = [](0x1)
>> class(ans)
ans = double
>> sscanf('6000000000', '%ld')
ans = [](0x1)
>> 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 = [](0x1)
>> class(ans)
ans = double
>> sscanf('6000000000 ffff', '%ld %lx')
ans = [](0x1)
>> class(ans)
ans = double
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?47741>
_______________________________________________
Nachricht gesendet von/durch Savannah
http://savannah.gnu.org/