On 09/16/2017 01:51 PM, Max Reitz wrote: > This generic function (along with its implementations for different > types) determines whether two QObjects are equal. > > Signed-off-by: Max Reitz <[email protected]> > ---
> + case QNUM_DOUBLE:
> + switch (num_y->kind) {
> + case QNUM_I64:
> + case QNUM_U64:
> + return false;
> + case QNUM_DOUBLE:
> + /* Comparison in native double type */
> + return num_x->u.dbl == num_y->u.dbl;
I saw comments mentioning the odd behavior of NaN; one other odd
behavior is that this treats -0.0 as equal to 0.0. But that's fine by
me (it matches C semantics of double == double).
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
