comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
To: "John B. Matthews" <nospam@nospam.com>
Cc: comp.lang.ada@ada-france.org
Subject: Re: Float to String
Date: Mon, 8 Nov 2004 23:24:58 -0600
Date: 2004-11-08T23:24:58-06:00	[thread overview]
Message-ID: <mailman.86.1099978055.10401.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: nospam-D1F460.19432408112004@news-server.woh.rr.com

To the contrary, my friend.

One still must convert the floating-point binary number to decimal.
Binary-coded-decimal simply means that the decimal digits are
encoded with four bits each, but the decimal digits must be
computed just the same.

Furthermore, if the binary value is not converted to decimal with
the number of digits I specified earlier, precision is lost when
converting the decimal value back to binary for use in computation.

----- Original Message ----- 
From: "John B. Matthews" <nospam@nospam.com>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada-france.org>
Sent: November 08, 2004 6:40 PM
Subject: Re: Float to String


> In article 
> <mailman.85.1099945145.10401.comp.lang.ada@ada-france.org>,
> "David C. Hoos" <david.c.hoos.sr@ada95.com> wrote:
> 
> [...]
>> The problem in that case was that values stored in an Oracle database
>> when later extracted sometimes differed in the lsb.
>> 
>> What makes the problem similar is that Oracle required the data to be
>> stored in decimal format.  The problem with that is that decimal numbers
>> are not, in general, exactly representable in binary.  E.g. the decimal
>> number 0.1 is a non-terminating binary number.
> 
> Indeed. To guarantee portability among the 90-odd Oracle platforms, 
> they typically store numeric data using binary coded decimal (BCD) 
> with exponent. This neatly avoids the problem of binary-decimal 
> conversion.
> 
> Might the data type Interfaces.COBOL.Packed_Decimal (or something 
> similar) be a useful intermediate storage format?
> 
> -- 
> John
> ----
> jmatthews at wright dot edu
> www dot wright dot edu/~john.matthews/
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada-france.org
> http://www.ada-france.org/mailman/listinfo/comp.lang.ada
> 
>



  reply	other threads:[~2004-11-09  5:24 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-08 17:06 Float to String Pascal Obry
2004-11-08 18:29 ` Jean-Pierre Rosen
2004-11-08 19:03 ` Jeffrey Carter
2004-11-08 20:13 ` David C. Hoos
2004-11-08 20:18 ` David C. Hoos
2004-11-09  0:40   ` John B. Matthews
2004-11-09  5:24     ` David C. Hoos, Sr. [this message]
2004-11-08 21:29 ` Nick Roberts
2004-11-09 17:58   ` Peter Hermann
2004-11-10  9:38     ` Peter Hermann
2004-11-10 12:12       ` Larry Kilgallen
2004-11-09  8:39 ` Dmitry A. Kazakov
2004-11-09 18:17   ` Pascal Obry
2004-11-10  8:53     ` Dmitry A. Kazakov
2004-11-10 11:15       ` Samuel Tardieu
2004-11-10 14:35         ` Dmitry A. Kazakov
2004-11-10 15:00         ` Peter Hermann
2004-11-10 15:35         ` Marius Amado Alves
2004-11-10 16:35           ` Dmitry A. Kazakov
2004-11-10 17:28             ` Marius Amado Alves
2004-11-11 15:25               ` Dmitry A. Kazakov
2004-11-11 16:40                 ` Marius Amado Alves
2004-11-11 18:31                   ` Dmitry A. Kazakov
2004-11-11 22:27                     ` Marius Amado Alves
2004-11-12 12:19                       ` Dmitry A. Kazakov
2004-11-12 14:55                         ` Marius Amado Alves
2004-11-10  5:05 ` Steve
2004-11-10 15:37   ` Pascal Obry
2004-11-10 16:29     ` Alex R. Mosteo
2004-11-10 16:48       ` Pascal Obry
2004-11-10 18:02         ` Marius Amado Alves
2004-11-10 19:40           ` Jeffrey Carter
2004-11-10 21:04             ` Marius Amado Alves
2004-11-11  3:33     ` Steve
2004-11-11  7:51       ` tmoran
2004-11-11 12:32         ` Pascal Obry
2004-11-11 15:53           ` David C. Hoos, Sr.
2004-11-11 16:17             ` Pascal Obry
2004-11-11 17:36             ` Jeffrey Carter
2004-11-12  0:01               ` David C. Hoos, Sr.
2004-11-12  0:30                 ` Jeffrey Carter
2004-11-11 12:30       ` Pascal Obry
2004-11-13 16:37 ` Ginduskina
2004-11-13 18:41   ` Björn Lundin
2004-11-13 16:39 ` Ginduskina
2004-11-13 16:49   ` Simon Wright
2004-11-13 16:53   ` David C. Hoos, Sr.
2004-11-13 16:55   ` Pascal Obry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox