Algebraic.evalhf - evaluate an Algebraic expression using hardware floating-point arithmetic
|
Calling Sequence
|
|
double evalhf() throws MapleException
|
|
Description
|
|
•
|
The evalhf function evaluates the Maple expression represented by the current Algebraic object using the Maple evalhf command. The result is returned as a double.
|
•
|
The current Algebraic object is unchanged by this call.
|
•
|
Not all Algebraic expressions can be evaluated using the Maple evalhf command. Algebraic objects representing expressions that cannot be evaluated raise a MapleException if evalhf is called.
|
|
|
Examples
|
|
import com.maplesoft.openmaple.*;
|
import com.maplesoft.externalcall.MapleException;
|
class Example
|
{
|
public static void main( String notused[] ) throws MapleException
|
{
|
String mapleArgs[];
|
Engine engine;
|
Algebraic a;
|
double r;
|
int i;
|
mapleArgs = new String[1];
|
mapleArgs[0] = "java";
|
engine = new Engine( mapleArgs, new EngineCallBacksDefault(),
|
null, null );
|
a = engine.evaluate( "1/sin(Pi*7/8):" );
|
r = a.evalhf();
|
System.out.println( a );
|
System.out.println( r );
|
}
|
}
|
|
|
Executing this code should produce the following output.
1/sin(1/8*Pi)
|
2.613125929752753
|
|
|
|
|
Download Help Document
Was this information helpful?