[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Use a hex string
From: |
Jamie Lokier |
Subject: |
Re: [Qemu-devel] Use a hex string |
Date: |
Tue, 24 May 2011 06:30:57 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Anthony Liguori wrote:
> On 05/23/2011 06:02 PM, Jamie Lokier wrote:
> >Richard W.M. Jones wrote:
> >>The problem is to be able to send 64 bit memory and disk offsets
> >>faithfully. This doesn't just fail to solve the problem, it's
> >>actually going to make it a whole lot worse.
> >
> >Such offsets would be so much more readable in hexadecimal.
> >
> >So why not use a string "0xffff800012340000" instead?
>
> This doesn't change the fundamental issue here. Javascript's internal
> representation for integers isn't 2s compliment, but IEEE794. This
> means the expectations about how truncation/overflow is handled is
> fundamentally different.
No, the point is it's a string so Javascript numerics doesn't come
into it, no overflow, no truncation, no arithmetic. Every program
that wants to handle them handles them as a *string-valued attribute*
externally, and whatever representation it needs for a particular
attribute internally. (Just as enum values are represented with
strings too).
In the unlikely event that someone wants to do arithmetic on these
values *in actual Javascript*, it'll be tricky for them, but the
representation doesn't have much to do with that.
-- Jamie
- Re: [Qemu-devel] [PATCH] qemu: json: Fix parsing of integers >= 0x8000000000000000, (continued)
- Re: [Qemu-devel] [PATCH] qemu: json: Fix parsing of integers >= 0x8000000000000000, Daniel P. Berrange, 2011/05/23
- Re: [Qemu-devel] [PATCH] qemu: json: Fix parsing of integers >= 0x8000000000000000, Markus Armbruster, 2011/05/23
- Re: [Qemu-devel] [PATCH] qemu: json: Fix parsing of integers >= 0x8000000000000000, Anthony Liguori, 2011/05/23
- Re: [Qemu-devel] [PATCH] qemu: json: Fix parsing of integers >= 0x8000000000000000, Markus Armbruster, 2011/05/24
- [Qemu-devel] Use a hex string (was: [PATCH] qemu: json: Fix parsing of integers >= 0x8000000000000000), Jamie Lokier, 2011/05/23
- Re: [Qemu-devel] Use a hex string, Anthony Liguori, 2011/05/23
- Re: [Qemu-devel] Use a hex string,
Jamie Lokier <=
- Re: [Qemu-devel] [PATCH] qemu: json: Fix parsing of integers >= 0x8000000000000000, Anthony Liguori, 2011/05/23