[Top][All Lists]

[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 10:12:28 -0400

On Tue, Oct 15, 2013 at 9:54 AM, Fedemone <address@hidden> wrote:
Thanks for the suggestion, in fact even the original line had the single(..)
function ar argument for the Java method, so I think is true. Unluckily the
result is not what expected:

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

I suspect the single() precision object is first converted by octave into a double, so the problem stays the same.
octave:1> x = javaMethod('doubleToLongBits', 'java.lang.Double', 10.07)
x =
<Java object: java.lang.Long>

This is theoretically correct, the method is supposed to return a java long value. What's not there is the automatic conversion into a int64 octave value.

So I think the bottom line is that some boxing/unboxing methods are missing for less usual octave types (single, integers...).


reply via email to

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