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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ub!planck!mercury!westley From: westley%planck.uucp@acsu.buffalo.edu (Terry J. Westley) Newsgroups: comp.lang.ada Subject: determining the next model number >= any arbitrary number Message-ID: <1991Jan2.152418.11783@planck.uucp> Date: 2 Jan 91 15:24:18 GMT Sender: news@planck.uucp (Usenet News) Distribution: na Organization: Calspan Advanced Technology Center, Buffalo, NY Originator: westley@mercury Nntp-Posting-Host: mercury List-Id: Given the following: type PERCENTAGE is digits 6 range 0.0..110.0; Since 100.0 cannot be exactly expressed in a binary floating point representation (available on most modern machines), then the following must yield a model number less than or greater than 100.0, never exactly 100.0. Complete : PERCENTAGE := 100.0; I don't believe the RM says anything about which an implementation must pick. So, how can I guarantee that this assignment will always yield a value greater than or equal to 100.0? Maybe: Complete : PERCENTAGE := 100.0 + PERCENTAGE'small; But, since 'small is so "small," I can't depend on this for any arbitrary assignment, especially when the assigned value is significantly larger than 'small. What I really want is something more like the following: Complete : PERCENTAGE := 100.0 + PERCENTAGE'epsilon(100.0); if only epsilon were defined to accept a parameter instead of simply returning the size of the model number interval around 1.0. Any ideas on how can this could be done? -- -- Terry J. Westley Arvin/Calspan Advanced Technology Center P.O. Box 400, Buffalo, NY 14225 westley%planck.uucp@acsu.buffalo.edu