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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!lll-lcc!unisoft!dual!ucbvax!cartan!brahms!desj From: desj@brahms (David desJardins) Newsgroups: comp.lang.ada Subject: Re: Getting the integer part of a real Message-ID: <240@cartan.Berkeley.EDU> Date: Mon, 10-Nov-86 17:12:31 EST Article-I.D.: cartan.240 Posted: Mon Nov 10 17:12:31 1986 Date-Received: Tue, 11-Nov-86 06:23:40 EST References: <38000034@gypsy.UUCP> <996@wayback.UUCP> Sender: daemon@cartan.Berkeley.EDU Reply-To: desj@brahms (David desJardins) Followup-To: comp.lang Organization: Math Dept. UC Berkeley List-Id: In article <996@wayback.UUCP> arny@wayback.UUCP (Arny B. Engelson) writes: >The above algorithm only works for POSITIVE values of X! For example, if >X = -0.7 this will return -1 instead of 0. The "integer part of a real >number" is a truncate function: Not to restart the flame wars (I hope!), but when this topic has been discussed in the past, the consensus (at least among mathematicians) has been that "round-down" is preferable to "round-toward-zero." At the very least it is not clear that the latter is preferable. -- David desJardins