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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.belwue.de!not-for-mail From: Peter Hermann Newsgroups: comp.lang.ada Subject: Re: Float to String Date: Tue, 9 Nov 2004 17:58:38 +0000 (UTC) Organization: InterNetNews at News.BelWue.DE (Stuttgart, Germany) Message-ID: References: <2va6q0F2gvpugU1@uni-berlin.de> NNTP-Posting-Host: sinus.csv.ica.uni-stuttgart.de X-Trace: news.BelWue.DE 1100023118 15395 129.69.118.70 (9 Nov 2004 17:58:38 GMT) X-Complaints-To: news@news.belwue.de NNTP-Posting-Date: Tue, 9 Nov 2004 17:58:38 +0000 (UTC) User-Agent: tin/1.7.4-20040111 ("Taransay") (UNIX) (Linux/2.4.27 (i686)) Xref: g2news1.google.com comp.lang.ada:6089 Date: 2004-11-09T17:58:38+00:00 List-Id: Nick Roberts wrote: > If it is not necessary for the string to be human interpretable, you could > take the approach: use streaming to convert the floating point value into > a Storage_Element_Array; write out the array as a sequence of hexadecimal > values into the string. Obviously you do the reverse to convert back to > floating point values. this is not portable concerning different floating representations. (and I guess this was the original requirement) Jean-Pierre Rosen's recommendation: >This should be possible if you write it in base 2. Note that Get will >accept a binary floating point number, but you have to write you own >Put. suggests for improvement for Ada2005: add a formal parameter "base" for real types to subroutine put. -- --Peter Hermann(49)0711-685-3611 fax3758 ica2ph@csv.ica.uni-stuttgart.de --Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen --http://www.csv.ica.uni-stuttgart.de/homes/ph/ --Team Ada: "C'mon people let the world begin" (Paul McCartney)