summaryrefslogtreecommitdiff
path: root/libguile/numbers.h
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2001-10-06 20:48:27 +0000
committerMarius Vollmer <mvo@zagadka.de>2001-10-06 20:48:27 +0000
commitc0060c9589ba8ca3638638f17b495c84b80f8154 (patch)
tree1dbb4c6cf09d9ee4482261e334fe87b5f60d00dc /libguile/numbers.h
parent71dcdbf9a0c198eecc0a51fd3c8897d63fcbe3c0 (diff)
downloadguile-c0060c9589ba8ca3638638f17b495c84b80f8154.tar.gz
Corrected definition of SCM_MOST_POSITIVE_FIXNUM. Boy was I confused.
Diffstat (limited to 'libguile/numbers.h')
-rw-r--r--libguile/numbers.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/libguile/numbers.h b/libguile/numbers.h
index f2a355ac5..e1dc39adc 100644
--- a/libguile/numbers.h
+++ b/libguile/numbers.h
@@ -55,8 +55,13 @@
*
* Inums are exact integer data that fits within an SCM word. */
+/* SCM_T_SIGNED_MAX is (- (expt 2 n) 1),
+ * SCM_MOST_POSITIVE_FIXNUM should be (- (expt 2 (- n 2)) 1)
+ * which is the same as (/ (- (expt 2 n) 4) 4)
+ */
+
#define SCM_I_FIXNUM_BIT (SCM_LONG_BIT - 2)
-#define SCM_MOST_POSITIVE_FIXNUM (SCM_T_SIGNED_BITS_MAX/8-1)
+#define SCM_MOST_POSITIVE_FIXNUM ((SCM_T_SIGNED_BITS_MAX-3)/4)
#define SCM_MOST_NEGATIVE_FIXNUM (-SCM_MOST_POSITIVE_FIXNUM-1)
/* SCM_SRS is signed right shift */
@@ -83,7 +88,7 @@
#define SCM_INUM0 (SCM_MAKINUM (0))
-/* SCM_MAXEXP is the maximum double precision expontent
+/* SCM_MAXEXP is the maximum double precision exponent
* SCM_FLTMAX is less than or scm_equal the largest single precision float
*/