comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Truncation of FLOAT values
Date: 1996/04/21
Date: 1996-04-21T00:00:00+00:00	[thread overview]
Message-ID: <dewar.830122309@schonberg> (raw)
In-Reply-To: 4lal5h$4qb@cliffy.lfwc.lockheed.com

Michael said:

"Unless you are telling me that single implementation of an Ada compiler
_may_, in practice, round 2.5 to 3 and round 3.5 to 3, you can write
an implementation specific solution. However, in the case where a
compiler does round x.5 to x (and not x+1), the solution is less
simple."

  That seems unlikely, but rounding 2.5 to 2 and 3.5 to 4 is not only
  allowed, but likely to be encountered in practice (e.g. the Alsys
  compiler for the 386 did this). This style of rounding is called
  unbiased rounding, and corresponds to IEEE round-to-nearest-even.
  Ada 95 forbids this kind of rounding (unless you use the specific
  attribute), but Ada 83 certainly allows it.

Also, note my discussion of problems with non-model numbers.





  reply	other threads:[~1996-04-21  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-18  0:00 Truncation of FLOAT values Franz Kruse
1996-04-18  0:00 ` Cordes MJ
1996-04-19  0:00   ` Robert Dewar
1996-04-20  0:00     ` Cordes MJ
1996-04-21  0:00       ` Robert Dewar [this message]
1996-04-19  0:00   ` John Herro
1996-04-19  0:00     ` Robert Dewar
1996-04-22  0:00       ` John Herro
1996-04-22  0:00     ` Robert I. Eachus
1996-04-19  0:00   ` Peter Hermann
replies disabled

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