Skip to Content.
Sympa Menu

freetds - Re: [freetds] patch: corrects the reading of large integer values when represented as double

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] patch: corrects the reading of large integer values when represented as double
  • Date: Wed, 19 May 2004 09:17:57 -0400

On Wed, 19 May 2004, "Jose Luu" <jluu AT applia.fr> wrote:
> In my case, 16 digit integers were transmitted this way and I was
> losing the last digit (became always 0).
>
> This is somehow a borderline case since only 90% of the 16 digit
> integers can be represented using a double float. However, it would make
> the library more robust to allow for such cases.
> Also note that the Sybase openclient library is converting to 16 places.
>
> In the patch below I have allowed for float8 conversion to 16 places.

Thanks, Jose. I applied your patch. I'm not completely convinced it's
right, but it is (at least) harmless and seems to be compatible with
Sybase's implementation.

IIRC, double precision is good only for 15 positions. Frediano once
showed me how to examine the bit pattern, to know how precisely a number
can be so represented. I'd like to be convinced that your 16th position
is significant.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page