From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 21 Jul 93 15:31:16 GMT From: eachus@mitre-bedford.arpa (Robert I. Eachus) Subject: Re: Question on fixed point range constraints Message-ID: List-Id: In article <1993Jul20.174520.2243@iplmail.orl.mmc.com> kcronin@orl.mmc.com wri tes: > I'm trying to create a fixed point type without narrowly > constraining its range. I'd like to use an attribute for this. > Can anyone suggest a way to do this? Sure: type Velocity is delta 0.01 range Integer'POS(Integer'FIRST) * 0.01..Integer'POS(Integer'LAST) * 0.01; The "trick" behind this is that 'POS returns universal_integer so the two bounds are of type universal real. Since they the bounds are static, they will be evaluated exactly. Of course if you want the size of your type to be other than the size of Integer, use another static integer type. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...