X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 39DFAD1B1C8 for ; Sun, 11 Jul 2004 17:24:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50482-07 for ; Sun, 11 Jul 2004 20:24:28 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 26D4FD1B1A0 for ; Sun, 11 Jul 2004 17:24:25 -0300 (ADT) Received: (qmail 11729 invoked from network); 11 Jul 2004 20:24:24 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 11 Jul 2004 20:24:24 -0000 Subject: Re: patch for getXXX methods From: Dave Cramer Reply-To: pg@fastcrypt.com To: Oliver Jowett Cc: "pgsql-jdbc@postgresql.org" In-Reply-To: <40F15718.7000302@opencloud.com> References: <1089407362.1508.292.camel@localhost.localdomain> <40EF1D5D.2050509@opencloud.com> <1089416849.1515.298.camel@localhost.localdomain> <40F15718.7000302@opencloud.com> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1089577486.1508.316.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sun, 11 Jul 2004 16:24:46 -0400 Content-Transfer-Encoding: 7bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/96 X-Sequence-Number: 10480 Oliver, I don't believe you will lose precision if the number is below MAX_LONG ? When I tested it on my system, I was able to retrieve a double that was equal to MAX_LONG without losing precision. I understand your concern about silently discarding the fractional portion, but I also believe if the user is using this, then they know what they are doing. Time will tell. Dave On Sun, 2004-07-11 at 11:04, Oliver Jowett wrote: > Dave Cramer wrote: > > Attached, with -cb this time > > Thanks. Comments: > > How you handle bytes and shorts is inconsistent with how you handle > longs; we should consistently do it one way or the other. Since you lose > precision going via a double, that probably means the BigInteger approach. > > The shared conversion/rangecheck logic should be done once in a helper > function rather than duplicated -- call the helper with appropriate > range info and cast the result. > > I still don't like silently discarding any fractional portion of the value. > > -O > > > > !DSPAM:40f15727282821451612596! > > -- Dave Cramer 519 939 0336 ICQ # 14675561