🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.ada
Article #1051

Re: Getting the integer part of a real

#1051
From: Robert Firth
Date: Fri, 07 Nov 1986 13:47
28 lines
1209 bytes
Given

	x : float;
	i : integer;

then the line

	if (i > x) then ...

won't work, since ">" isn't defined between integers
and floats.  This is perhaps what is meant:

	if float(i) > x then ...

However, this does not really help the hard-core numerical
programmer, who most likely wants X rounded but left in
FLOATING representation - since otherwise he can use only
a very restricted subrange of float.

What we really need is the set


	function FLOOR (X : FLOAT) return FLOAT;
		 CEIL
		 ROUND
		 TRUNC

and let's make them generic in the domain type.
Technical Details
Message-ID: <389@aw.sei.cmu.edu.sei.cmu.edu>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!seismo!rochester!pt.cs.cmu.edu!sei.cmu.edu!firth
References: <38000034@gypsy.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!seismo!rochester!pt.cs.cmu.edu!sei.cmu.edu!firth
From: firth@sei.cmu.edu (Robert Firth)
Newsgroups: net.lang.ada
Subject: Re: Getting the integer part of a real
Message-ID: <389@aw.sei.cmu.edu.sei.cmu.edu>
Date: Fri, 7-Nov-86 08:47:38 EST
Article-I.D.: aw.389
Posted: Fri Nov  7 08:47:38 1986
Date-Received: Sat, 8-Nov-86 05:00:01 EST
References: <38000034@gypsy.UUCP>
Sender: netnews@sei.cmu.edu
Reply-To: firth@bd.sei.cmu.edu.UUCP (PUT YOUR NAME HERE)
Organization: Carnegie-Mellon University, SEI, Pgh, Pa
Lines: 28