Hi Thorsten,

> I'm experimenting a bit with the 'java' function, and the StringBuilder
> ...
> (java "java.lang.Math" 'sqrt 4)

It needs a different call:

   : (scl 6)
   -> 6

   : (java "java.lang.Math" 'sqrt  (-6 . 64.0))
   -> 8000000

   : (round @)
   -> "8.000"

As you probably know, the Java interface is described in
http://picolisp.com/wiki/?javacode

It writes:

   While integers are directly passed to/from the JVM, other number formats can
   be passed to the JVM as cons pairs consisting of an ID in the CAR and the
   value in the CDR. These are:

    • 1 for Byte
    • 2 for Char
    • 3 for Short
    • 4 for Integer (default, usually not needed)
    • 8 for Long
    • 9 for BigInteger

   If the CAR is a negative number, the value is taken as a double scaled by the
   negated number of digits.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to