Gauche > Archives > 2015/06/09

2015/06/09 07:47:23 UTCkaki
#
gosh> (fixnum-width)
61
gosh> (greatest-fixnum)
2305843009213693951
gosh> (- (expt 2 (- (fixnum-width) 1)) 1)
1152921504606846975
gosh> (fixnum? (greatest-fixnum))
#t
gosh> (fixnum? (+ 1 (greatest-fixnum)))
#f
#
この場合、(fixnum-width) は 62 じゃないんですか? http://practical-scheme.net/wiliki/wiliki.cgi?R6RS%3A%E7%BF%BB%E8%A8%B3%3AStandard%20Libraries%3A11.2%20Fixnums
2015/06/09 07:55:32 UTCkaki
#
2^(w−1) − 1 http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-12.html
#
2^w - 1 http://practical-scheme.net/gauche/man/gauche-refj_43.html
2015/06/09 10:11:03 UTCshiro
#
ぎゃー仕様を勘違いしてた