From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPKtM-0007bP-JD for qemu-devel@nongnu.org; Tue, 01 May 2012 17:45:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPKtJ-0005uG-U8 for qemu-devel@nongnu.org; Tue, 01 May 2012 17:45:52 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42246 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPKtJ-0005u2-Ml for qemu-devel@nongnu.org; Tue, 01 May 2012 17:45:49 -0400 Message-ID: <4FA05988.4090604@suse.de> Date: Tue, 01 May 2012 23:45:44 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <4F9C18DF.6030904@suse.de> <1335796410-8646-1-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1335796410-8646-1-git-send-email-mdroth@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v6 4/7] qapi: String visitor, use %f representation for floats List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org 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 cause= s > some issues: >=20 > - it uses 6 significant figures instead of 6 decimal places, which > means something like 155777.5 (which even has an exact floating poin= t > representation) will be rounded to 155778 when converted to a string= . >=20 > - 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. >=20 > - 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. >=20 > Instead, let's just use %f, which is what the QJSON and the QMP visitor= s > use. >=20 > Signed-off-by: Michael Roth Reviewed-by: Andreas F=E4rber /-F --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg