Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 18733 invoked from network); 31 Oct 2007 23:46:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Oct 2007 23:46:22 -0000 Received: (qmail 44531 invoked by uid 500); 31 Oct 2007 23:46:08 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 44409 invoked by uid 500); 31 Oct 2007 23:46:08 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 44398 invoked by uid 99); 31 Oct 2007 23:46:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Oct 2007 16:46:08 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.224.219.75] (HELO mail1.atl.registeredsite.com) (64.224.219.75) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Oct 2007 23:46:09 +0000 Received: from mail2.referentia.com (mail2.referentia.com [216.122.129.145]) by mail1.atl.registeredsite.com (8.12.11.20060308/8.12.11) with ESMTP id l9VNjlh4030067 for ; Wed, 31 Oct 2007 19:45:47 -0400 Received: from EETHKOTH (corp1.referentia.com [64.128.15.194]) by mail2.referentia.com (8.11.6/8.11.0) with ESMTP id l9VNjk003409 for ; Wed, 31 Oct 2007 13:45:46 -1000 (HST) (envelope-from jnewsham@referentia.com) From: "Jim Newsham" To: "'Derby Discussion'" References: <009201c81b2f$9b9c8c40$8700a8c0@referentia.com> Subject: RE: Is derby sql "real" equivalent to java "float" Date: Wed, 31 Oct 2007 13:45:37 -1000 Message-ID: <01da01c81c18$26de6100$8700a8c0@referentia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcgcFkFFb2eJO8GTSTu+EqB5hDwbsQAAPzhQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 In-Reply-To: X-Virus-Checked: Checked by ClamAV on apache.org Thanks for the pointer. It turns out I overlooked this documentation. I was reading the pdf file, and only saw the overview of the data types, and the assignability matrix. I guess I'll have to test my values for legal range before inserting into the database. It's unfortunate that there's a type range mismatch, though, as it introduces an additional, potential cause of failure which I suspect in most cases will not be expected or handled. If there is no longer a good reason for the mismatch, I too vote that it be removed. Thanks, Jim > -----Original Message----- > From: Dag.Wanvik@Sun.COM [mailto:Dag.Wanvik@Sun.COM] > Sent: Wednesday, October 31, 2007 1:32 PM > To: Derby Discussion > Subject: Re: Is derby sql "real" equivalent to java "float" > > Jim Newsham writes: > > > In the meantime, I'd like to ask. Should Java float always be safely > > settable to a field of Derby type REAL? This has been my assumption all > > along, and refderby.pdf seems to imply this. Or, are there edge cases, > such > > as perhaps NaN which will cause the set operation to fail. > > The limits I mentioned in a previous post are actually documented: > > Quote from http://db.apache.org/derby/docs/dev/ref/rrefsqlj14122.html > > > REAL value ranges: > > > > * Smallest REAL value: -3.402E+38 > > * Largest REAL value: 3.402E+38 > > * Smallest positive REAL value: 1.175E-37 > > * Largest negative REAL value: -1.175E-37 > > > > These limits are different from the java.lang.Float Java type limits. > > > > An exception is thrown when any double value is calculated or > > entered that is outside of these value ranges. > > Thanks, > Dag