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, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,329032975b221f1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-29 06:36:33 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!swiss.ans.net!news.dfn.de!news.belwue.de!news.uni-stuttgart.de!iris3.csv.ica.uni-stuttgart.de!ucaa2385 From: ucaa2385@iris3.csv.ica.uni-stuttgart.de (Peter Hermann) Newsgroups: comp.lang.ada Subject: Re: Q: common types?! Date: 29 Sep 1994 11:37:11 GMT Organization: Comp.Center (RUS), U of Stuttgart, FRG Distribution: world Message-ID: <36e8t7$19ql@info2.rus.uni-stuttgart.de> References: <36c1c0$lve@pong.lasc.lockheed.com> NNTP-Posting-Host: iris3.csv.ica.uni-stuttgart.de Date: 1994-09-29T11:37:11+00:00 List-Id: Tony Leavitt (tony@deepthought.Sgi.COM) wrote: : This package would define all kinds of types for feet, nautical : miles, degrees, radians, etc, ad nuasium, for all different kinds and sizes : of float and integers. Am I about to go insane by trying this? Or, does yes : type float64 is new float ; : for float64'SIZE use 64 ; The type float has been introduced as a predefined type which is different for each compiler/hardware and cannot be used for portable programs. Coming from other languages without typing system, the type float is offered in Ada for a first, unclean solution which will be abandoned once the typing system is understood. The above "rape" cannot work because the size of the root type is fixed and cannot be changed for a subtype, neither enlarged nor reduced. You are "deriving" in any way from another type. That means that you create a different type being incompatible the the original type. Therefore, for the same purpose, you easily write type my_float_type is digits 14 ; or type my_float_type is digits 14 range 0.0 .. 1.234e7 ; for example. -- Peter Hermann Tel:+49-711-685-3611 Fax:3758 ph@csv.ica.uni-stuttgart.de Pfaffenwaldring 27, 70569 Stuttgart Uni Computeranwendungen Team Ada: "C'mon people let the world begin" (Paul McCartney)