Article View: comp.lang.modula2
Article #4231Re: MathLib0 procedures
From: Alan Lovejoy
Date: Tue, 10 May 1988 01:58
Date: Tue, 10 May 1988 01:58
30 lines
1655 bytes
1655 bytes
In article <8805091402.AA23129@harris.cis.ksu.edu> Info-Modula2 Distribution List <INFO-M2%UCF1VM.bitnet@jade.berkeley.edu> writes:
>Correct. That's all our implementation does: "RETURN (FLOAT(x));"
But he wrote "FLOAT(CARDINAL(x))", which is not necessarily equivalent!
>>> PROCEDURE entier(x:REAL): INTEGER;
>>>just another form of INTEGER(TRUNC(x)) ?
>
>This one is a little different. I understand it to be the "nearest integer
>to REAL x". So I guess it is a TRUNC with rounding. Any REAL number with
>a fractional part >= .5 is rounded up to the next highest integer.
>Anything < .5 is equivalent to TRUNC(x).
In PIM2/3rd Ed., pg. 162, Wirth states:
TRUNC(x) real number x truncated to its integral part (of type
CARDINAL).
Wirth does not define "entier". But when I researched it back in 1984,
If found it to be a europeanism for "floor", which does no rounding.
Now if I could just remember where I found that piece of information...
--
Alan Lovejoy; alan@pdn; 813-530-8241; Paradyne Corporation: Largo, Florida.
Disclaimer: Do not confuse my views with the official views of Paradyne
Corporation (regardless of how confusing those views may be).
Motto: Never put off to run-time what you can do at compile-time!
Technical Details
Message-ID:
<3099@pdn.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!pdn!alanReferences:
<8805091402.AA23129@harris.cis.ksu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!pdn!alan From: alan@pdn.UUCP (Alan Lovejoy) Newsgroups: comp.lang.modula2 Subject: Re: MathLib0 procedures Message-ID: <3099@pdn.UUCP> Date: 10 May 88 01:58:27 GMT References: <8805091402.AA23129@harris.cis.ksu.edu> Reply-To: alan@pdn.UUCP (0000-Alan Lovejoy) Organization: Paradyne Corporation, Largo, Florida Lines: 30