From: Dave Cramer <pg@fastcrypt.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: patch for getXXX methods
Date: Sun, 11 Jul 2004 16:24:46 -0400
Message-ID: <1089577486.1508.316.camel@localhost.localdomain> (raw)
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>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: pg@fastcrypt.com, oliver@opencloud.com
Subject: Re: patch for getXXX methods
In-Reply-To: <1089577486.1508.316.camel@localhost.localdomain>
References: <1089407362.1508.292.camel@localhost.localdomain> <40EF1D5D.2050509@opencloud.com> <1089416849.1515.298.camel@localhost.localdomain> <40F15718.7000302@opencloud.com> <1089577486.1508.316.camel@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox