From: Adrian Hoe <mailbox@adrianhoe.nospam.com.my>
Subject: Re: float with 24-bit resolution
Date: Wed, 03 Sep 2003 00:05:27 +0800
Date: 2003-09-03T00:05:27+08:00 [thread overview]
Message-ID: <3f54bf19_1@news.tm.net.my> (raw)
In-Reply-To: <vl0bs87osh9j53@corp.supernews.com>
Randy Brukardt wrote:
> "Matthew Heaney" <matthewjheaney@earthlink.net> wrote in message
> news:bj40b.59$yQ3.11@newsread1.news.atl.earthlink.net...
>
>>"Adrian Hoe" <mailbox@nospam.adrianhoe.com.my> wrote in message
>>news:3f405ef4$1_1@news.tm.net.my...
>>
>>>But subtracting the value of Angle_Delta makes the code more
>>>understandable, doesn't it? That translates to -360.0000000 ..
>>
>>+359.9999571.
>>
>>No, it does not. The practice of subtracting off T'Small from the upper
>>bound in the type declaration is distracting, and only adds unecesssary
>>noise. The language is the way it is, so don't fight it.
>
>
> Bull. :-)
>
> The phony declaration of the upper bound is confusing to the reader; users
> should not take advantage of this "convinience". Consider:
>
> Limit : constant := 360.0;
> The_Small : constant := Limit / 2.0**23;
> type Matts_Type is delta The_Small range -Limit .. Limit;
> Obj : Matts_Type;
> if Matts_Type'Last /= Limit then
> Put_Line ("Yep, the specified limit wasn't used");
> end if;
> Obj := Limit; -- Raises Constraint_Error!
>
> The last is likely to be mysterious during maintenance, even to be
> knowledgable user.
>
> type Randys_Type is delta The_Small range -Limit+The_Small ..
> Limit-The_Small;
"-Limit+The_Small .. Limit-The_Small" does not comply to my requirement
which the angle must be in -360.0000000 to +359.9999571.
> does not suffer from that confusion, and is hardly any harder to read. (Note
> that this "convinence" applies to both bounds of the fixed point type, and
> fixed point types don't get the most negative value that integer types do.)
>
> Randy.
>
>
>
>
>
next prev parent reply other threads:[~2003-09-02 16:05 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-15 11:59 float with 24-bit resolution mailbox
2003-08-15 12:24 ` Jeffrey Creem
2003-08-15 12:52 ` Adrian Hoe
2003-08-15 12:54 ` Adrian Hoe
2003-08-15 15:01 ` Jeffrey Creem
2003-08-16 15:29 ` Matthew Heaney
2003-08-15 13:39 ` Mark Johnson
2003-08-15 16:56 ` Robert I. Eachus
2003-08-15 18:08 ` Mark Johnson
2003-08-16 3:30 ` Robert I. Eachus
2003-08-18 13:39 ` Mark Johnson
2003-08-20 21:12 ` Robert I. Eachus
2003-08-21 13:38 ` Mark Johnson
2003-08-16 15:32 ` Matthew Heaney
2003-08-16 15:26 ` Matthew Heaney
2003-08-15 19:56 ` Simon Wright
2003-08-16 4:21 ` Adrian Hoe
2003-08-16 12:59 ` Jeffrey Creem
2003-08-16 15:35 ` Matthew Heaney
2003-08-17 11:40 ` Simon Wright
2003-08-17 13:46 ` Matthew Heaney
2003-08-18 5:05 ` Adrian Hoe
2003-08-18 13:14 ` Matthew Heaney
2003-08-19 3:09 ` Adrian Hoe
2003-08-19 13:00 ` Matthew Heaney
2003-08-30 5:02 ` Randy Brukardt
2003-09-02 16:05 ` Adrian Hoe [this message]
2003-09-03 3:31 ` Matthew Heaney
2003-09-03 20:46 ` Simon Wright
2003-09-04 1:43 ` Randy Brukardt
2003-09-04 9:53 ` Jean-Pierre Rosen
2003-09-05 3:46 ` Randy Brukardt
2003-09-05 17:16 ` Warren W. Gay VE3WWG
2003-09-05 19:37 ` Randy Brukardt
2003-09-06 20:48 ` Warren W. Gay VE3WWG
2003-09-08 7:53 ` Dmitry A. Kazakov
2003-09-04 1:45 ` Randy Brukardt
2003-08-16 3:42 ` Robert I. Eachus
2003-08-16 15:38 ` Matthew Heaney
2003-08-16 16:36 ` Robert I. Eachus
2003-08-16 15:22 ` Matthew Heaney
2003-08-17 11:46 ` Simon Wright
2003-08-18 10:04 ` Martin Dowie
2003-08-20 19:53 ` Robert I. Eachus
2003-08-20 23:36 ` Ludovic Brenta
2003-08-21 13:54 ` Mark Johnson
2003-08-21 14:35 ` Ludovic Brenta
2003-08-22 14:07 ` Mark Johnson
2003-08-22 15:12 ` Jean-Pierre Rosen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox