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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-17 00:06:39 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!vixen.cso.uiuc.edu!news.ksu.ksu.edu!lazrus.cca.rockwell.com!fmsa.cca.rockwell.com!wemagor From: wemagor@fmsa.cca.rockwell.com (Wayne Magor) Subject: 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 Date: Thu, 16 Mar 1995 22:29:10 GMT Date: 1995-03-16T22:29:10+00:00 List-Id: Is it legal for the program below to print 0.0? The reason I question it is because it is DEC's Vax Ada that returns 0.0, but their Alpha Ada returns 1.0. The 'Machine_Rounds is FALSE for Vax and TRUE for Alpha, but a compiler on a Sun machine has 'Machine_Rounds to be FALSE and yet still returns 1.0. Is there a way to adjust for these differences or is there just a bug in the Vax Ada compiler? Is the conversion different if it is exactly half way between the fixed point model numbers? procedure Fixed_Pt is type Fixed is delta 1.0 range -10.0 .. 10.0; Fix : Fixed; Flt : Float := 0.999; begin Fix := Fixed(Flt); -- should Fix alway be set to 1.0? end Fixed_Pt;