diff options
author | Marius Vollmer <mvo@zagadka.de> | 2001-10-06 20:48:27 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2001-10-06 20:48:27 +0000 |
commit | c0060c9589ba8ca3638638f17b495c84b80f8154 (patch) | |
tree | 1dbb4c6cf09d9ee4482261e334fe87b5f60d00dc /libguile/numbers.h | |
parent | 71dcdbf9a0c198eecc0a51fd3c8897d63fcbe3c0 (diff) | |
download | guile-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.h | 9 |
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 */ |