From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, STOX_REPLY_TYPE,TVD_FINGER_02 autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,91965a012526b259 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!easynet-monga!easynet.net!news.clara.net!wagner.news.clara.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: Float to String Date: Mon, 8 Nov 2004 23:24:58 -0600 Organization: Cuivre, Argent, Or Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1099978056 6317 212.85.156.195 (9 Nov 2004 05:27:36 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Tue, 9 Nov 2004 05:27:36 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: "John B. Matthews" Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:6068 Date: 2004-11-08T23:24:58-06:00 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" Newsgroups: comp.lang.ada To: Sent: November 08, 2004 6:40 PM Subject: Re: Float to String > In article > , > "David C. Hoos" 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 > >