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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sunybcs!planck!aardvark!westley From: westley@aardvark.uucp (Terry J. Westley) Newsgroups: comp.lang.ada Subject: 'small not power of 2 (Was: language support for fixed-point arithmetic) Message-ID: <1990Mar23.144315.499@planck.uucp> Date: 23 Mar 90 14:43:15 GMT References: <787@eedsp.eedsp.gatech.edu> <1990Mar19.175559.17109@planck.uucp> Sender: news@planck.uucp (Usenet News) Reply-To: westley%hercules@planck.UUCP (Terry J. Westley) Followup-To: comp.lang.ada Organization: Calspan Corporation ATC Buffalo, NY List-Id: In article eachus@aries.mitre.org (Robert I. Eachus) writes: > Huh? Why must 'SMALL be a power of two? By default 'SMALL is a >power of two, but this is an arbitrary choice which can be overridden >by a "for foo'SMALL use ..." declaration. Since confession is supposed to be good, I confess that this capability had never penetrated the fog in my brain. I know that I have read it in Booch (_Software_Engineering_with_Ada_) and in the RM, but it never clicked. Thanks. I tried your types METERS and NAUTICAL_MILES example from the referenced article. The compiler I used (Verdix 6.0 on Sun 4) generated code for the conversion functions. The compiler crashed when I used higher levels of optimization. (Note to anyone from Verdix who might be reading this: I sent a report in today with the details.) Unchecked_Conversion, of course, works. Do you know of any compilers that are "smart" enough to detect this situation? Terry J. Westley Arvin/Calspan Advanced Technology Center P.O. Box 400, Buffalo, NY 14225 acsu.buffalo.edu!planck!hercules!westley