summaryrefslogtreecommitdiff
path: root/MLKInteger.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-04 18:44:16 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-04 18:44:16 +0200
commitce1bfc2039cc673c3c9099933c05c9fac3e88ae9 (patch)
tree91380866c5adc53e908e977a7734f11a2bd08f86 /MLKInteger.m
parent90e6023292e2bfe927bd633bac42fc355bb9f4d1 (diff)
Make it possible to disable fixnum support by supplying -DNO_FIXNUMS as a compiler flag.
Diffstat (limited to 'MLKInteger.m')
-rw-r--r--MLKInteger.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/MLKInteger.m b/MLKInteger.m
index 43af24d..b2ce0a8 100644
--- a/MLKInteger.m
+++ b/MLKInteger.m
@@ -165,12 +165,20 @@ DEFINE_MPZ_TWOARG_INTONLY_OPERATION (lcm:, mpz_lcm)
-(BOOL) fitsIntoFixnum
{
+#ifdef NO_FIXNUMS
+ return NO;
+#else
return (mpz_sizeinbase (self->value, 2) <= (sizeof (id)) * 8 - 2);
+#endif
}
-(id) fixnumValue
{
+#ifdef NO_FIXNUMS
+ return self;
+#else
return MLKFixnumWithInt ([self intValue]);
+#endif
}
-(int) intValue