Numeric.doubleValue - return the value of the Numeric object as a double
|
Calling Sequence
|
|
double doubleValue() throws MapleException
|
|
Description
|
|
•
|
The doubleValue function returns the value represented in the Numeric as a Java double. If the value does not fit exactly into a Java double, an approximation is returned.
|
|
|
Examples
|
|
import com.maplesoft.openmaple.*;
|
import com.maplesoft.externalcall.MapleException;
|
class Example
|
{
|
public static void main( String notused[] ) throws MapleException
|
{
|
String mapleArgs[];
|
Engine engine;
|
Numeric n;
|
double d;
|
mapleArgs = new String[1];
|
mapleArgs[0] = "java";
|
engine = new Engine( mapleArgs, new EngineCallBacksDefault(),
|
null, null );
|
n = (Numeric)engine.evaluate( "evalf[60](Pi):" );
|
d = n.doubleValue();
|
System.out.println( n );
|
System.out.println( d );
|
}
|
}
|
|
|
Executing this code produces the following output.
3.14159265358979323846264338327950288419716939937510582097494
|
3.141592653589793
|
|
|
|
|
Download Help Document
Was this information helpful?