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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dcab94c78b71ea2b X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Fixed Point Numbers Date: 1999/05/28 Message-ID: <7il2g3$pff$1@nnrp1.deja.com>#1/1 X-Deja-AN: 482953380 References: X-Http-Proxy: 1.0 x35.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Fri May 28 03:28:05 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-05-28T00:00:00+00:00 List-Id: In article , Philip Bradley wrote: > What is the impact of the differing deltas in the following type > definitions : > > type Long_Type is delta 180.0/2**31 range -180.0 .. 180.0; > for Long_Type'Small use 180.0/2**31; > for Long_Type'Size use 32; Right, GNAT will allow this, and indeed even if you did not have the Size clause would use a size of 32. What GNAT does is to include the end points, UNLESS this would cause the size to get awkwardly bigger (32 to 33 bits certainly counts :-) in which case it will exclude end points as allowed by the RM. This behavior is explicitly allowed (and indeed one may say intended, since this is the reason that a compiler is allowed to exclude the end points), but unfortunately, compilers are not required to take this reasonable approach, and you may have to manually exclude the end point. The representations should be identical in either case, so the second form is the more portable, if less convenient, form. Robert Dewar Ada Core Technologies Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.