From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8mcQ-0000bA-V9 for qemu-devel@nongnu.org; Thu, 12 Nov 2009 22:14:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8mcM-0000Vd-T6 for qemu-devel@nongnu.org; Thu, 12 Nov 2009 22:14:38 -0500 Received: from [199.232.76.173] (port=44282 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8mcM-0000VS-MR for qemu-devel@nongnu.org; Thu, 12 Nov 2009 22:14:34 -0500 Received: from mail2.shareable.org ([80.68.89.115]:35176) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N8mcM-0007yB-BU for qemu-devel@nongnu.org; Thu, 12 Nov 2009 22:14:34 -0500 Date: Fri, 13 Nov 2009 03:14:31 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH 3/3] Add test suite for json marshalling Message-ID: <20091113031431.GF19405@shareable.org> References: <1257967478-4847-1-git-send-email-aliguori@us.ibm.com> <1257967478-4847-3-git-send-email-aliguori@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1257967478-4847-3-git-send-email-aliguori@us.ibm.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Luiz Capitulino Anthony Liguori wrote: > After checking that we can demarshal, marshal again and compared to > the expected decoded value. This doesn't work so well for floats > because they cannot be accurately represented in decimal but we try > our best. Good sprintf/scanf/strtod implementations do guarantee that what's printed and then parsed gets back the same floating point value, as long as you have printed sufficient decimal digits. I'm not sure if FLT_DIG/DLB_DIG are the right number of digits, though. Glibc's documentation of those is confusing and they might mean something a little different. -- Jamie