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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!postnews.google.com!m58g2000cwm.googlegroups.com!not-for-mail From: "frikk" Newsgroups: comp.lang.ada Subject: Re: Reading Float Data from a binary file into ada Date: 30 Jan 2007 11:56:55 -0800 Organization: http://groups.google.com Message-ID: <1170187015.001438.296780@m58g2000cwm.googlegroups.com> References: <1170172307.292500.256090@m58g2000cwm.googlegroups.com> <1170180250.735903.10580@a34g2000cwb.googlegroups.com> NNTP-Posting-Host: 12.129.98.129 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1170187032 19510 127.0.0.1 (30 Jan 2007 19:57:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 30 Jan 2007 19:57:12 +0000 (UTC) In-Reply-To: <1170180250.735903.10580@a34g2000cwb.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 TRY0PX01 Complaints-To: groups-abuse@google.com Injection-Info: m58g2000cwm.googlegroups.com; posting-host=12.129.98.129; posting-account=192wHg0AAAAzciSzoZsEBI9bw5pVCopO Xref: g2news2.google.com comp.lang.ada:8731 Date: 2007-01-30T11:56:55-08:00 List-Id: On Jan 30, 1:04 pm, "frikk" wrote: > On Jan 30, 12:56 pm, "Jeffrey R. Carter" wrote: > > > frikk wrote: > > > > Basically I need to be able to read in the binary data byte by byte > > > but store it into a 32 bit Float. The C union example above uses the > > > same memory address for the Float as it does for the size 4 char > > > array. I don't even know if the VB dump will correspond with the way > > > ada handles floats or not, but I'll worry about that later. > > > Any reason you can't call this C function from Ada? > > > -- > > Jeff Carter > > "I soiled my armor, I was so scared." > > Monty Python & the Holy Grail > > 71 > > Thank you for the responses so far. > > We are using simulink and calling ada through s-functions. If we use > C, we'd have to get the data back to the matlab workspace, then pass > it into an ada module. It is prefered to keep all of the data inside > the ada modules without coming back to the workspace. > > 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? > > And yes - it appears that the data dumped is not actually a float but > fixed point. This is how VB apparently handles 'Float' data types. > > If I had data in a binary file, even disregarding the fractional > piece, how could I get this into an ada variable? If I could even get > a round about syntax to help me get started in setting up the memory > locations and such that would be helpful. Its hard to find specific > examples sometimes. > > Thanks! > Blaine Actually - now that I look at it Visual Basic is using a 'Single' type, not 'Float'. This may make more sense now.