Algebraic.evalhf
evaluate an Algebraic expression using hardware floating-point arithmetic
Calling Sequence
Description
Examples
double evalhf() throws MapleException
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.
import com.maplesoft.openmaple.*;
import com.maplesoft.externalcall.MapleException;
class Example
{
public static void main( String notused[] ) throws MapleException
String[] mapleArgs = { "java" };
Engine engine = new Engine( mapleArgs, new EngineCallBacksDefault(), null, null );
Algebraic a = engine.evaluate( "1/sin(Pi*7/8):" );
double 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
See Also
evalhf
ExternalCalling/Java/MapleException
OpenMaple
OpenMaple/Java/Algebraic
OpenMaple/Java/API
OpenMaple/Java/Engine/evaluate
Download Help Document