From: "Andreas Färber" <afaerber@suse.de>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v6 4/7] qapi: String visitor, use %f representation for floats
Date: Tue, 01 May 2012 23:45:44 +0200 [thread overview]
Message-ID: <4FA05988.4090604@suse.de> (raw)
In-Reply-To: <1335796410-8646-1-git-send-email-mdroth@linux.vnet.ibm.com>
Am 30.04.2012 16:33, schrieb Michael Roth:
> Currently string-output-visitor formats floats as %g, which is nice in
> that trailing 0's are automatically truncated, but otherwise this causes
> some issues:
>
> - it uses 6 significant figures instead of 6 decimal places, which
> means something like 155777.5 (which even has an exact floating point
> representation) will be rounded to 155778 when converted to a string.
>
> - output will be presented in scientific notation when the normalized
> form requires a 10^x multiplier. Not a huge deal, but arguably less
> readable for command-line arguments.
>
> - due to using scientific notation for numbers requiring more than 6
> significant figures, instead of hard-defined decimal places, it
> fails a lot of the test-visitor-serialization unit tests for floats.
>
> Instead, let's just use %f, which is what the QJSON and the QMP visitors
> use.
>
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
/-F
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
parent reply other threads:[~2012-05-01 21:45 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1335796410-8646-1-git-send-email-mdroth@linux.vnet.ibm.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FA05988.4090604@suse.de \
--to=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).