promotional, or sales literature without prior written consent from
MIT in each case. */
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/flonum.c,v 9.25 1988/08/15 20:47:15 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/flonum.c,v 9.26 1989/05/10 21:57:37 arthur Rel $
*
* This file contains support for floating point arithmetic. Most
* of these primitives have been superceded by generic arithmetic.
#include "prims.h"
#include "flonum.h"
#include "zones.h"
+
+#define BOOLEAN_RESULT(x) \
+ return ((x) ? SHARP_T : NIL)
\f
/************************************/
/* BINARY FLOATING POINT OPERATIONS */
Arg_1_Type(TC_BIG_FLONUM);
Arg_2_Type(TC_BIG_FLONUM);
Set_Time_Zone(Zone_Math);
- return
- Make_Unsigned_Fixnum(((Get_Float(Arg1)) == (Get_Float(Arg2))) ? 1 : 0);
+ BOOLEAN_RESULT ((Get_Float(Arg1)) == (Get_Float(Arg2)));
}
DEFINE_PRIMITIVE ("GREATER-THAN-FLONUM?", Prim_greater_flonum, 2, 2, 0)
Arg_1_Type(TC_BIG_FLONUM);
Arg_2_Type(TC_BIG_FLONUM);
Set_Time_Zone(Zone_Math);
- return
- Make_Unsigned_Fixnum(((Get_Float(Arg1)) > (Get_Float(Arg2))) ? 1 : 0);
+ BOOLEAN_RESULT ((Get_Float(Arg1)) > (Get_Float(Arg2)));
}
DEFINE_PRIMITIVE ("LESS-THAN-FLONUM?", Prim_less_flonum, 2, 2, 0)
Arg_1_Type(TC_BIG_FLONUM);
Arg_2_Type(TC_BIG_FLONUM);
Set_Time_Zone(Zone_Math);
- return
- Make_Unsigned_Fixnum(((Get_Float(Arg1)) < (Get_Float(Arg2))) ? 1 : 0);
+ BOOLEAN_RESULT ((Get_Float(Arg1)) < (Get_Float(Arg2)));
}
\f
/***********************************/
Arg_1_Type(TC_BIG_FLONUM);
Set_Time_Zone(Zone_Math);
- return Make_Unsigned_Fixnum((Get_Float(Arg1) == 0.0) ? 1 : 0);
+ BOOLEAN_RESULT (Get_Float(Arg1) == 0.0);
}
DEFINE_PRIMITIVE ("POSITIVE-FLONUM?", Prim_positive_flonum, 1, 1, 0)
Arg_1_Type(TC_BIG_FLONUM);
Set_Time_Zone(Zone_Math);
- return Make_Unsigned_Fixnum((Get_Float(Arg1) > 0.0) ? 1 : 0);
+ BOOLEAN_RESULT (Get_Float(Arg1) > 0.0);
}
DEFINE_PRIMITIVE ("NEGATIVE-FLONUM?", Prim_negative_flonum, 1, 1, 0)
Arg_1_Type(TC_BIG_FLONUM);
Set_Time_Zone(Zone_Math);
- return Make_Unsigned_Fixnum((Get_Float(Arg1) < 0.0) ? 1 : 0);
+ BOOLEAN_RESULT (Get_Float(Arg1) < 0.0);
}
\f
/* (COERCE-INTEGER-TO-FLONUM FIXNUM-OR-BIGNUM)