From 21f6cfda213fc01c27fa11c2fc4792a0219aee53 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 26 Nov 2003 05:01:25 +0000 Subject: [PATCH] Fix bug: DOUBLE_TO_FIXNUM_P was using limits that assumed the conversion used rounding; in fact, it uses truncation. --- v7/src/microcode/object.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v7/src/microcode/object.h b/v7/src/microcode/object.h index 2d077446c..0e37499c9 100644 --- a/v7/src/microcode/object.h +++ b/v7/src/microcode/object.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: object.h,v 9.54 2003/02/28 04:34:38 cph Exp $ +$Id: object.h,v 9.55 2003/11/26 05:01:25 cph Exp $ Copyright 1986,1987,1988,1989,1990,1992 Massachusetts Institute of Technology Copyright 1993,1995,1997,1998,2000,2001 Massachusetts Institute of Technology @@ -399,8 +399,8 @@ extern SCHEME_OBJECT * memory_base; #define FIXNUM_TO_DOUBLE(fixnum) ((double) (FIXNUM_TO_LONG (fixnum))) #define DOUBLE_TO_FIXNUM_P(number) \ - (((number) > (((double) SMALLEST_FIXNUM) - 0.5)) && \ - ((number) < (((double) BIGGEST_FIXNUM) + 0.5))) + (((number) > ((double) (SMALLEST_FIXNUM - 1))) \ + && ((number) < ((double) (BIGGEST_FIXNUM + 1)))) #ifdef HAVE_DOUBLE_TO_LONG_BUG #define DOUBLE_TO_FIXNUM double_to_fixnum -- 2.25.1