This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
(floor 1.0) -> 1.0, integer or not?
- From: "Hoehle, Joerg-Cyril" <Joerg-Cyril dot Hoehle at t-systems dot com>
- To: kawa at sources dot redhat dot com
- Date: Tue, 25 Nov 2003 20:28:46 +0100
- Subject: (floor 1.0) -> 1.0, integer or not?
Hi,
I was surprised to discover the above, whereas R5RS clearly states p.23 "These procedures return integers."
#|kawa:348|# (integer? 123)
#t
#|kawa:349|# (integer? 1.0)
#t -- so at least, it's compliant by the letter of R5RS
#|kawa:350|# (invoke 1.0 'get-class)
class gnu.math.DFloNum
Not the class that I'd expect from an integer!?!
Notwithstanding, code like
((primitive-array-new <byte>)
(min 100000 (abs (* 1000 (invoke rnd 'nextGaussian)))))
[generate random-length sequence <100KB, mostly <2KB]
works, i.e. Kawa makes a Java integer out of the float/double where it's needed.
I can't remember reading about this in Kawa.doc
Regards,
Jorg Hohle.
Using kawa-1.7 on MS-Windows and suse-Linux-9