comp.lang.ada
 help / color / mirror / Atom feed
* Float to Fixed conversions
@ 1995-03-16 22:29 Wayne Magor
  1995-03-18 13:01 ` Tucker Taft
  1995-03-19  1:31 ` Robert Dewar
  0 siblings, 2 replies; 4+ messages in thread
From: Wayne Magor @ 1995-03-16 22:29 UTC (permalink / 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;



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1995-03-20 21:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-03-16 22:29 Float to Fixed conversions Wayne Magor
1995-03-18 13:01 ` Tucker Taft
1995-03-20 21:29   ` Wayne Magor
1995-03-19  1:31 ` Robert Dewar

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