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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4ac6504560f5ef27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-04 10:05:29 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!wn52feed!worldnet.att.net!207.35.177.252!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Little Endian -> Big Endian (Ada95 / GNAT), Whats with floating point types? References: <4046b474_1@127.0.0.1> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 04 Mar 2004 12:51:24 -0500 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1078422621 198.96.223.163 (Thu, 04 Mar 2004 12:50:21 EST) NNTP-Posting-Date: Thu, 04 Mar 2004 12:50:21 EST Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:6060 Date: 2004-03-04T12:51:24-05:00 List-Id: Marius Amado Alves wrote: >>... Also, there is a small performance penalty paid for >>shuffling bits around to achieve platform independence. > > > But surely less than converting to an ASCII image and back. (I suspect that, > contrary to what has been indicated, the significant performance loss in the > ASCII solution is of time, not space.) > > But the ASCII solution is a nice, safe one if you don't have the time or the > will or the possibility to learn to use or just to use the compiler's. > Remember Ada has the wonderful 'Image and 'Value attributes which take care > of the conversion for you. I'm no floating point numeric expert, but by converting to a standard, say IEEE floating point format, you can still represent a machine dependant number with repeating decimal places in a IEEE floating point format (I assume). Mind you, this depends heavily upon the differences between the two formats. By converting to ASCII, you lose that, unless you encode the fact that the last digit repeats, in some way (like the number "1.33333*", where * might represent "repeat"). If they don't do that, then the number has been rounded, and thus does not quite represent the original value any more ;-) (at a minimum, it is less faithful than it could be). -- Warren W. Gay VE3WWG http://ve3wwg.tk