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,2aaba1527862ef22 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!homer!news.glorb.com!news-spur1.glorb.com!news.glorb.com!newscon02.news.prodigy.net!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Reading Float Data from a binary file into ada Date: Tue, 30 Jan 2007 15:51:42 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1170172307.292500.256090@m58g2000cwm.googlegroups.com> <1170180250.735903.10580@a34g2000cwb.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1170190302 17416 192.74.137.71 (30 Jan 2007 20:51:42 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 30 Jan 2007 20:51:42 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:aRS5PifYwKWVl5sR4CUWfyZnwyw= Xref: g2news2.google.com comp.lang.ada:8742 Date: 2007-01-30T15:51:42-05:00 List-Id: "frikk" writes: > I've been working with ada for awhile, but I'm still not very good at > the syntaxes of more complicated data management commands. How does > ada store its floating point data? Is it stored like an ieee standard? Ada and C are the same in this regard -- Ada and C compilers will typically store Floats in the way the hardware normally stores them, which is IEEE on many machines. Of course, neither language standard requires any particular representation, but it's usually safe to trust that C float and Ada Float are represented the same way on the same machine. The VB format you mentioned doesn't sound like IEEE float, but anyway, if you want to write an Ada algorithm that mimics the C one, you should use Unchecked_Conversion to do the "cast" from array-of-4-bytes to Float, if that's what it does. - Bob