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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ccb707f4c91a5f2 X-Google-Attributes: gid103376,public From: kst@thomsoft.com (Keith Thompson) Subject: Re: Java vs Ada 95 (Was Re: Once again, Ada absent from DoD SBIR solicitation) Date: 1996/10/18 Message-ID: #1/1 X-Deja-AN: 190268492 sender: news@thomsoft.com (USENET News Admin @flash) x-nntp-posting-host: pulsar references: <325D7F9B.2A8B@gte.net> <3266DC85.D45@dynamite.com.au> organization: Thomson Software Products, San Diego, CA, USA newsgroups: comp.lang.ada originator: kst@pulsar Date: 1996-10-18T00:00:00+00:00 List-Id: In <3266DC85.D45@dynamite.com.au> Alan Brain writes: [...] > If you really have to have 32 bits, just use > > type INTEGER_32 is new INTEGER; > for INTEGER_32'size use 32; Um, no. type Integer_32 is range -2**31 .. +2**31-1; Your version assumes that Integer is at least 32 bits. This is true for many but not all implementations. Digression: My version admittedly assumes a 2's-complement representation. Here's a version that doesn't. Twos_Complement : constant := System.Min_Int = -System.Max_Int - 1; type Integer_32 is range -2**31 + Boolean'Pos(not Twos_Complement) .. +2**31 - 1; The extra little bit of portability probably isn't worth the esthetic cost. end Digression; -- Keith Thompson (The_Other_Keith) kst@thomsoft.com <*> TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2706 FIJAGDWOL