help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Basic question: usage of Java methods in Octave


From: Michael Goffioul
Subject: Re: Basic question: usage of Java methods in Octave
Date: Tue, 15 Oct 2013 08:24:15 -0400

On Tue, Oct 15, 2013 at 4:26 AM, Fedemone <address@hidden> wrote:
Hi Philip,

sorry forr late answer, I forgot in previous days...

You are right, the code is really ugly, and my duty right now is to
reverse-engineer it, in order to make this third-party-code usable locally
in Octave rather than Matlab.
That's where all the problems rise, and I'm try to do what you suggest: to
dissect, to de-assembly in simplier code and to understand what are the
single elements (some are surely variables, other are functions declared
elsewhere, Integer and Float should be Java classes... a real mess).

By the way, trying to use the Java Method seems a bit less intuitive than
expected:

octave:1> x = javaMethod('floatToIntBits', 'java.lang.Float', 10.07)
error: [java] java.lang.IllegalArgumentException

Actually no numer is accepted in this way, and any manual I'm lookin ginto
is lacking of the very basic introduction to method usage...

Maybe it's because 10.07 is internally converted by octave into Java "double". Try this:

x = javaMethod('doubleToLongBits', 'java.lang.Double', 10.07)

or this:

x = javaMethod('floatToIntBits', 'java.lang.Float', single(10.07))

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]