qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 10/19] qlit: Support all types of QNums


From: Markus Armbruster
Subject: Re: [PATCH v3 10/19] qlit: Support all types of QNums
Date: Tue, 24 Nov 2020 13:22:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 24/11/20 10:55, Markus Armbruster wrote:
>>> +        /* Larger than UINT64_MAX: */
>>> +        QLIT_QNUM_DOUBLE(18446744073709552e3),
>>> +        /* Smaller than INT64_MIN: */
>>> +        QLIT_QNUM_DOUBLE(-92233720368547758e2),
>> Why "larger than UINT64_MAX" and "smaller than INT64_MIN"?
>> 
>
> I guess the point is to test values that are only representable as a
> double, so (double)((uint64_t)INT64_MAX+1) wouldn't be very useful for 
> that: as the expression shows, it would not be a QNUM_VAL_INT but it
> would be representable as QNUM_VAL_UINT.
>
> So these are the cases that matter the most, even though -1, 0 and
> INT64_MAX+1 could be nice to have.

qnum_is_equal()'s contract:

 * Doubles are never considered equal to integers.




reply via email to

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