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!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 30 Jan 2007 14:23:29 -0600 Date: Tue, 30 Jan 2007 20:23:20 +0000 From: Martin Dowie User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Reading Float Data from a binary file into ada References: <1170172307.292500.256090@m58g2000cwm.googlegroups.com> <2qKdna5hWvrXOSLYnZ2dnUVZ8sTinZ2d@bt.com> <1170187796.181930.11010@m58g2000cwm.googlegroups.com> In-Reply-To: <1170187796.181930.11010@m58g2000cwm.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <0r-dnfH5TO3cNCLYRVnytAA@bt.com> NNTP-Posting-Host: 81.158.163.147 X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-syVfOvFpyqWgNwEeM9sg1PKPQoF9btKooPxjfDGASIETL3bdour5b1uIKeEJJK7q6x6BFYzVEG1XLAR!OdxW7fLJ4YJQypm8PJu3rwCJq5Lx3JySa+QCtmBXTqBsayZu3EJ68ZcYJrunQYzD X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:8736 Date: 2007-01-30T20:23:20+00:00 List-Id: frikk wrote: [snip] > Niklas - I think this is exactly what I need to do. > > Martin - Thank you for the example. I will go through that and see > what I can use - it looks very useful though. May I get some > clarification on exactly what this line does: > type FP is delta FP_Delta range -2.0**15 .. 2.0**15-FP_Delta; > for FP'Small use FP_Delta; > for FP'Size use 32; > > What is the delta used for? The delta means the type is a 'fixed point' type (a real but not a 'float'). It's an abstraction of an integer with a fractional LSB. See http://www.adapower.com/rm95.php for a technical specification, or see http://www.adapower.com/launch.php?URL=http%3A%2F%2Fwww.it.bton.ac.uk%2Fstaff%2Fje%2Fadacraft%2F for an introduction to then. With the 'delta' you specify the minimum "LSB" your willing to accept in terms of accuracy - the compiler is free to give you better! In practice the 'delta' is best defined as a power-of-2 (and a compiler isn't likely to change that!). If you need an "LSB" that's a power-of-10, use a 'decimal type'. All covered in John's book. Cheers -- Martin