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=2.3 required=5.0 tests=BAYES_00,HK_RANDOM_FROM, INVALID_MSGID,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9316ecaabdc23114 X-Google-Attributes: gid103376,public From: czgrr Subject: Re: Rounded off Date: 1999/06/15 Message-ID: <7k544c$h7e$1@nnrp1.deja.com>#1/1 X-Deja-AN: 489759699 References: <7jmq0c$uq$1@nnrp1.deja.com> <7jn9af$63i$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x40.deja.com:80 (Squid/1.1.22) for client 193.192.234.4 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Tue Jun 15 08:50:21 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) Date: 1999-06-15T00:00:00+00:00 List-Id: In article <7jn9af$63i$1@nnrp1.deja.com>, Robert Dewar 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.