[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Octave 64-bit for Windows can't parse long hex integers
From: |
Mike Miller |
Subject: |
Re: Octave 64-bit for Windows can't parse long hex integers |
Date: |
Wed, 13 Apr 2016 09:10:41 -0700 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Wed, Apr 13, 2016 at 14:37:40 +0200, Francesco Potortì wrote:
> On Octave 4.0.1 64-bit compiled for Windows, downloaded today from
> <http://www.tatsuromatsuoka.com/octave/Eng/Win/>, there seems to be a
> bug when Octave parses long hex literals. This is what I observe, is
> this really a bug or am I missing something?
>
> On Debian:
>
> >> printf("%x\n", 123456789000)
> 1cbe991a08
> >> format long; 0x1cbe991a08
> ans = 123456789000
>
>
> On Windows:
>
> >> printf("%x\n", 123456789000)
> 1cbe991a08
> >> format long; 0x1cbe991a08
> ans = 4294967295
>
> In practice, when parsing a hex literal bigger than 2^32-1, octave reads
> it as 0xffffffff.
Good catch, this looks like a bug.
Can you also try hex2dec and sscanf:
>> format long; hex2dec ("1cbe991a08")
ans = 123456789000
>> sscanf ("1cbe991a08", "%lx")
ans = 123456789000
--
mike