[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/7] qapi: String visitor, use %f represenation
From: |
Michael Roth |
Subject: |
Re: [Qemu-devel] [PATCH 4/7] qapi: String visitor, use %f represenation for floats |
Date: |
Mon, 30 Apr 2012 09:12:06 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sat, Apr 28, 2012 at 06:20:47PM +0200, Andreas Färber wrote:
> Am 27.04.2012 22:21, 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 6 uses significant figures instead of 6 decimal places, which
>
> "it uses 6 significant"
>
Doh, I'll send an updated patch with the commit msg fixed.
> > 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 sig figs instead of hard-defined decimal places, it
>
> "six figs"?
>
significant figures, "scientific notation" is probably clearer, I'll
include it in the update.
> > 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 <address@hidden>
>
> /-F
>
> --
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
>
- [Qemu-devel] [PATCH v5 0/7] add fixed-width visitors and serialization tests/fixes, Michael Roth, 2012/04/27
- [Qemu-devel] [PATCH 1/7] qapi: add Visitor interfaces for uint*_t and int*_t, Michael Roth, 2012/04/27
- [Qemu-devel] [PATCH 2/7] qapi: QMP input visitor, handle floats parsed as ints, Michael Roth, 2012/04/27
- [Qemu-devel] [PATCH 4/7] qapi: String visitor, use %f represenation for floats, Michael Roth, 2012/04/27
- [Qemu-devel] [PATCH 5/7] qapi: add String visitor coverage to serialization unit tests, Michael Roth, 2012/04/27
- [Qemu-devel] [PATCH 3/7] qapi: unit tests for visitor-based serialization, Michael Roth, 2012/04/27
- [Qemu-devel] [PATCH 6/7] qdev: use int32_t container for devfn property, Michael Roth, 2012/04/27
- [Qemu-devel] [PATCH 7/7] qdev: switch property accessors to fixed-width visitor interfaces, Michael Roth, 2012/04/27
- Re: [Qemu-devel] [PATCH v5 0/7] add fixed-width visitors and serialization tests/fixes, Paolo Bonzini, 2012/04/28