comp.lang.ada
 help / color / mirror / Atom feed
From: czgrr <czgrr@my-deja.com>
Subject: Re: Rounded off
Date: 1999/06/15
Date: 1999-06-15T00:00:00+00:00	[thread overview]
Message-ID: <7k544c$h7e$1@nnrp1.deja.com> (raw)
In-Reply-To: 7jn9af$63i$1@nnrp1.deja.com

In article <7jn9af$63i$1@nnrp1.deja.com>,
  Robert Dewar <robert_dewar@my-deja.com> wrote:
> [snip] The proper answer for rounding float
> to integer is of course
>
>   Integer (X)
>
An additional note on this for those of you who, like me, still use
Ada83.

This is the text of a warning message from ObjectAda when the above
statement is compiled with the Ada83 error checking enabled...

simulation_programs.adb: Ada 83 Warning: line 945 col 42 LRM:4.6(33),
Rounding of Float to Integer now rounds away from 0, Continuing
Ada Compatibility Guide Number 16,
Notes:  Programs should not depend on how rounding is done
        and in Ada83 it was implementation-dependent.  In
        Ada9X it is always away from 0.

So if you are using Ada83 you need to check what your compiler does,
and if in doubt, write a function that does it the way you want.

czgrr

--
No email, please - reply to the newsgroup. Email may be posted.
My opinions are not necessarily those of my employer.
My suggestions might not be correct. Use at your own risk.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




      parent reply	other threads:[~1999-06-15  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-09  0:00 Rounded off dginc
1999-06-09  0:00 ` dennison
1999-06-09  0:00   ` David C. Hoos, Sr.
1999-06-10  0:00     ` Robert Dewar
1999-06-10  0:00   ` Robert Dewar
1999-06-14  0:00     ` William Dale
1999-06-15  0:00     ` czgrr [this message]
replies disabled

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