From 94b433ae606496da927ff3504b113da27f145663 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 22 Oct 2001 00:28:09 +0000 Subject: [PATCH] Add FLO:FINITE?. --- v7/src/runtime/fixart.scm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/v7/src/runtime/fixart.scm b/v7/src/runtime/fixart.scm index 1a4b62239..ef2101fd9 100644 --- a/v7/src/runtime/fixart.scm +++ b/v7/src/runtime/fixart.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: fixart.scm,v 1.6 2001/02/11 00:08:16 cph Exp $ +$Id: fixart.scm,v 1.7 2001/10/22 00:28:09 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Fixnum Arithmetic @@ -140,4 +141,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (->flonum x) (if (not (real? x)) (error:wrong-type-argument x "real number" '->FLONUM)) - (exact->inexact (real-part x))) \ No newline at end of file + (exact->inexact (real-part x))) + +(define (flo:finite? x) + (not (cond ((flo:> x 0.) + (and (flo:> x 1.) + (flo:= x (flo:/ x 2.)))) + ((flo:< x 0.) + (and (flo:< x -1.) + (flo:= x (flo:/ x 2.)))) + (else + (flo:= x 0.))))) \ No newline at end of file -- 2.25.1