comp.lang.ada
 help / color / mirror / Atom feed
From: wemagor@fmsa.cca.rockwell.com (Wayne Magor)
Subject: Float to Fixed conversions
Date: Thu, 16 Mar 1995 22:29:10 GMT
Date: 1995-03-16T22:29:10+00:00	[thread overview]
Message-ID: <D5K14n.C97@lazrus.cca.rockwell.com> (raw)


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;



             reply	other threads:[~1995-03-16 22:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-16 22:29 Wayne Magor [this message]
1995-03-18 13:01 ` Float to Fixed conversions Tucker Taft
1995-03-20 21:29   ` Wayne Magor
1995-03-19  1:31 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox