This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

(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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]