From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19071 invoked by alias); 22 Jun 2006 23:27:36 -0000 Received: (qmail 19062 invoked by uid 22791); 22 Jun 2006 23:27:35 -0000 X-Spam-Check-By: sourceware.org Received: from ausmtp06.au.ibm.com (HELO ausmtp06.au.ibm.com) (202.81.18.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 Jun 2006 23:27:32 +0000 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp06.au.ibm.com (8.13.6/8.13.6) with ESMTP id k5MNTN0P8040526 for ; Fri, 23 Jun 2006 09:29:23 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.250.237]) by sd0208e0.au.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k5MNUkOu242658 for ; Fri, 23 Jun 2006 09:30:46 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k5MNROi0002294 for ; Fri, 23 Jun 2006 09:27:24 +1000 Received: from [9.47.22.62] (dyn9047022062.beaverton.ibm.com [9.47.22.62]) by d23av04.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k5MNRMf2002213; Fri, 23 Jun 2006 09:27:23 +1000 Date: Thu, 22 Jun 2006 23:27:00 -0000 From: Wu Zhou To: Daniel Jacobowitz cc: gdb-patches@sourceware.org Subject: Re: [RFC] decimal float point patch based on libdecnumber: testcase In-Reply-To: <20060622202457.GA22230@nevyn.them.org> Message-ID: References: <20060622202457.GA22230@nevyn.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00342.txt.bz2 Hi Daniel, Thanks for the review. See below for my response. On Thu, 22 Jun 2006, Daniel Jacobowitz wrote: > Hi Wu, > > By and large this looks very good. There are a couple of minor > formatting issues, which I'll run through for you when I get a chance > if no one else does; it may not be until after the GCC Summit next > week, though. I will go through the patches to see if I find the formatting issues myself. If anybody can help point them out, that will be appreciated. > Moving libdecnumber into src is a bit tricky. I'll take care of that > when we're ready for the patch. It also has to go into src-release, > CVSROOT/modules, and some dependencies in Makefile.def. So don't worry > about that. Thanks. I won't bother to think about that then. > > I did have one question for you. This struck me as strange... > > On Thu, Jun 22, 2006 at 05:03:34AM +0800, Wu Zhou wrote: > > + # _Decimal64 constants, which can support up to 16 digits > > + gdb_test "p 1.2dd" " = 1.2" > > + gdb_test "p -1.2dd" " = -1.2" > > + gdb_test "p 1.234567890123456dd" " = 1.234567890123456" > > + gdb_test "p -1.234567890123456dd" " = -1.234567890123456" > > + gdb_test "p 1234567890123456.dd" " = 1234567890123456" > > + gdb_test "p -1234567890123456.dd" " = -1234567890123456" > > + > > + gdb_test "p 1.2E1dd" " = 12" > > + gdb_test "p 1.2E10dd" " = 1.2E\\+10" > > If "p 1234567890123456.dd" prints it back with digits, why does "p > 1.2E10dd" print it back with an exponent? Which would > "p 1200000000000000.dd" do? That is because they have different precision/exponent. Number 1234567890123456.dd have 16 digits, its coefficient is 1234567890123456, and exponent is 0, so it won't print back with an exponent. While in the case of "1.2E10dd", the coefficient is 12, exponent is 9, so it will print back with an exponent. And in exponent display mode, the coefficient will be normalized, in this case, to 1.2; and exponent get to 10 respectively. For "p 1200000000000000.dd", it will return 1200000000000000. It is equal to but different than 1.2E+15. Their precison is not the same. > > +proc test_arithmetic_expressions {} { > > + > > +# Arithmetic operations for DFP types are not yet implemented in GDB. > > + > > +} > > Might want some tests for whatever does happen if you try it, in the > meantime. It should give a sensible error message. Using my patched gdb, addition and multiple will return the following error message: (gdb) p 1.2df + 1.3df Argument to arithmetic operation not a number or boolean. (gdb) p 1.2df * 1.3df Argument to arithmetic operation not a number or boolean. Do you mean that we need to output something more close to the fact. to say, "Addition/Multiple of decimal floating point is not supported right now". or something other like this. If you want, I can do that. Regards - Wu Zhou