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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b9403e256f252f5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-20 17:35:22 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!dearn!blekul11!ccsdec1.ufsia.ac.be!reks.uia.ac.be!idefix.CS.kuleuven.ac.be! Belgium.EU.net!EU.net!news.sprintlink.net!cs.utexas.edu!bcm!newsfeed.rice.edu!nb.rockwell.com!lazrus.cca.rockwell.com!fmsa.cca.rockwell.com!wemagor From: wemagor@fmsa.cca.rockwell.com (Wayne Magor) Subject: Re: Float to Fixed conversions Message-ID: Sender: news@lazrus.cca.rockwell.com Nntp-Posting-Host: fmsa.cca.rockwell.com Reply-To: wemagor@fmsa.cca.rockwell.com (Wayne Magor) Organization: Rockwell International X-Newsreader: mxrn 6.18-27 References: Date: Mon, 20 Mar 1995 21:29:07 GMT Date: 1995-03-20T21:29:07+00:00 List-Id: In article , stt@henning.camb.inmet.com (Tucker Taft) writes: > >Conversions between (ordinary) fixed and float can either truncate or round. >The 'Machine_Rounds attribute of the *target* type "should" tell you >which one happens, but that attribute is mostly oriented toward operations >within a type, not conversions between types. Have you checked >the 'Machine_Rounds attribute of type Fix? Thanks to you and Robert for your advice on this question. I should have stated that I am using Ada 83, and I also should have been more clear about the type used for the attributes: Fix'Machine_Rounds Rounds the conversion ------------------ --------------------- DEC Vax Ada 83 FALSE No DEC Alpha Ada 83 TRUE Yes Rational Sun Ada 83 FALSE Yes The use of the value of Fix'Machine_Rounds to decide if an adjustment should be made before the conversion is apparently not adequate to guarantee that rounding is always performed. It seems the user must look at the value after the conversion to determine if the machine performed rounding. This is unfortunately inconvenient and slow. Wayne.