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!news.netcologne.de!newsfeed-fusi.netcologne.de!newsfeed.r-kom.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!not-for-mail From: Peter Hermann Newsgroups: comp.lang.ada Subject: Re: Float to String Date: Wed, 10 Nov 2004 09:38:57 +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 1100079537 17289 129.69.118.70 (10 Nov 2004 09:38:57 GMT) X-Complaints-To: news@news.belwue.de NNTP-Posting-Date: Wed, 10 Nov 2004 09:38:57 +0000 (UTC) User-Agent: tin/1.7.4-20040111 ("Taransay") (UNIX) (Linux/2.4.27 (i686)) Xref: g2news1.google.com comp.lang.ada:6106 Date: 2004-11-10T09:38:57+00:00 List-Id: addition: Peter Hermann wrote: > 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[intent]) "portable" is (my) synonym of "cross platform", of course. > 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. with http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AC-00070.TXT?rev=1.1 in mind, one could xfer not only in base 16 but up to base 36. The corresponding subroutine put then should care for trailing zeroes, when the printed radix mantissa exceeds the internal rep. -- --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)