comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Dowie <martin.dowie@btopenworld.com.delete>
Subject: Re: Reading Float Data from a binary file into ada
Date: Tue, 30 Jan 2007 20:23:20 +0000
Date: 2007-01-30T20:23:20+00:00	[thread overview]
Message-ID: <0r-dnfH5TO3cNCLYRVnytAA@bt.com> (raw)
In-Reply-To: <1170187796.181930.11010@m58g2000cwm.googlegroups.com>

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



  reply	other threads:[~2007-01-30 20:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-30 15:51 Reading Float Data from a binary file into ada frikk
2007-01-30 16:37 ` Dmitry A. Kazakov
2007-01-30 16:55 ` Jean-Pierre Rosen
2007-01-30 17:35   ` Ali Bendriss
2007-02-01 16:28   ` Ali Bendriss
2007-02-01 17:27     ` Jean-Pierre Rosen
2007-01-30 17:56 ` Jeffrey R. Carter
2007-01-30 18:04   ` frikk
2007-01-30 19:56     ` frikk
2007-01-31 18:30       ` Jeffrey R. Carter
2007-01-30 20:51     ` Robert A Duff
2007-01-31 18:25     ` Jeffrey R. Carter
2007-01-31 18:57       ` frikk
2007-01-30 19:31 ` Niklas Holsti
2007-01-30 21:14   ` Cesar Rabak
2007-01-30 21:36     ` frikk
2007-02-01 21:11   ` Simon Wright
2007-02-01 21:44     ` Niklas Holsti
2007-02-03 12:13       ` Simon Wright
2007-02-03 14:59         ` Gautier
2007-02-03 17:01           ` Simon Wright
2007-01-30 20:02 ` Martin Dowie
2007-01-30 20:09   ` frikk
2007-01-30 20:23     ` Martin Dowie [this message]
2007-01-31  3:54 ` Steve
2007-01-31  8:42   ` Maciej Sobczak
2007-01-31 14:12   ` frikk
2007-01-31 18:38     ` frikk
2007-02-01  0:05       ` Jeffrey R. Carter
2007-02-01  2:59       ` Steve
2007-02-01 16:05         ` Bob Spooner
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox