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,8200c5d9633351c4,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!g49g2000cwa.googlegroups.com!not-for-mail From: "=?iso-8859-1?B?Qmr2cm4=?=" Newsgroups: comp.lang.ada Subject: How to byte swap an IEEE Float? Date: 28 Jun 2005 06:53:42 -0700 Organization: http://groups.google.com Message-ID: <1119966822.201891.303810@g49g2000cwa.googlegroups.com> NNTP-Posting-Host: 213.114.86.167 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1119966828 12983 127.0.0.1 (28 Jun 2005 13:53:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 28 Jun 2005 13:53:48 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: g49g2000cwa.googlegroups.com; posting-host=213.114.86.167; posting-account=XtH-7w0AAAD9fnmY345GWHA6uyNTbG5H Xref: g2news1.google.com comp.lang.ada:11690 Date: 2005-06-28T06:53:42-07:00 List-Id: 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? Thanks Bj=F6rn