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,8200c5d9633351c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!news.glorb.com!tiscali!newsfeed1.ip.tiscali.net!feed.news.tiscali.de!news.belwue.de!news.uni-stuttgart.de!carbon.eu.sun.com!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.ada Subject: Re: How to byte swap an IEEE Float? Date: Tue, 28 Jun 2005 16:05:16 +0000 (UTC) Organization: BT Openworld Message-ID: References: <1119966822.201891.303810@g49g2000cwa.googlegroups.com> NNTP-Posting-Host: host81-154-188-69.range81-154.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com 1119974716 15169 81.154.188.69 (28 Jun 2005 16:05:16 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Tue, 28 Jun 2005 16:05:16 +0000 (UTC) In-Reply-To: <1119966822.201891.303810@g49g2000cwa.googlegroups.com> X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) Xref: g2news1.google.com comp.lang.ada:11693 Date: 2005-06-28T16:05:16+00:00 List-Id: Bj�rn wrote: > I need to read some float values from file that have been written in > big-endian byte order from a c-program. The simple swapping procedure > that I have just interchanges the byte order of type IEEE_Float_32 to > get little-endian. The problem is that for some values (eg. 33.229000) > it is a "NaN" when doing IEEE_Float_32'Read and I get a constraint > error (invalid data) from stream_io when the value is read. How do I > get around this? What's the source/target for the values? PowerPC/ARM/Intelx86/Alpha/etc??