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,FREEMAIL_FROM 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!news2.google.com!newsread.com!newsprint.newsread.com!news.glorb.com!wns13feed!worldnet.att.net!attbi_s01.POSTED!53ab2750!not-for-mail From: "Steve" Newsgroups: comp.lang.ada References: Subject: Re: Float to String X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: <24Bkd.74362$HA.12207@attbi_s01> NNTP-Posting-Host: 24.21.42.251 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s01 1100143998 24.21.42.251 (Thu, 11 Nov 2004 03:33:18 GMT) NNTP-Posting-Date: Thu, 11 Nov 2004 03:33:18 GMT Organization: Comcast Online Date: Thu, 11 Nov 2004 03:33:18 GMT Xref: g2news1.google.com comp.lang.ada:6135 Date: 2004-11-11T03:33:18+00:00 List-Id: I see two obvious choices, both of which are reasonably simple, neither of which is exact: 1) Write the value as a string representing a floating point value with as many significant digits as possible. Use an Ada.Text_Io to convert the value to a string, trim the string and add it to the XML text. 2) Write the value as an integer value. Since you are dealing with cosines, the range of values are between -1.0 and 1.0. These could be mapped between the integer values of 0 to 2^32-1, (or -2^31 to 2^31-1, take your pick). This would give you a precision of 1/(2^32), which may be sufficient for your application. You may be able to handle this directly by defining a fixed point type in Ada. I hope this helps, Steve (The Duck) "Pascal Obry" wrote in message news:u654dlnq8.fsf@obry.net... > > "Steve" writes: > > > Cross platform? Or just getting from point A to point B on the same > > architecture? > > I basically need to output an XML file with float values. These values are > cosine proximities between documents. I want to be able to read this XML file > in any computers. > > Pascal. > > -- > > --|------------------------------------------------------ > --| Pascal Obry Team-Ada Member > --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE > --|------------------------------------------------------ > --| http://www.obry.org > --| "The best way to travel is by means of imagination" > --| > --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595