qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 2/5] Support human unit formats in strtobytes, e


From: Jes Sorensen
Subject: [Qemu-devel] Re: [PATCH 2/5] Support human unit formats in strtobytes, eg. 1.0G
Date: Thu, 16 Sep 2010 12:14:06 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Lightning/1.0b3pre Thunderbird/3.1.3

On 09/16/10 09:19, Paolo Bonzini wrote:
> On 09/15/2010 09:31 PM, Jes Sorensen wrote:
>> Floating point is just plain wrong. If someone wants to do something
>> like in your example they really ask for an error.
> 
> An error, not an overflow.
> 
> Adding overflow checking on top of your patch is also fine.  Another
> possibility is to look ahead for the multiplier so that you correctly
> base the divider and do everything in 64.64 fixed point.  But it seems
> overkill compared to floating-point, whose 53-bit mantissa precision
> will almost always lead to exact results (large numbers usually have a
> lot of zeros at the end, both in binary and in decimal).

I think it would be quite reasonable not to accept anything more than
say 3-4 decimal points, since there are the t/g/m/k options as well.

Cheers,
Jes




reply via email to

[Prev in Thread] Current Thread [Next in Thread]