Algebraic.evalhf - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : OpenMaple : Java Application Programming Interface : Algebraic Class : OpenMaple/Java/Algebraic/evalhf

Algebraic.evalhf

evaluate an Algebraic expression using hardware floating-point arithmetic

 

Calling Sequence

Description

Examples

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

See Also

evalhf

ExternalCalling/Java/MapleException

OpenMaple

OpenMaple/Java/Algebraic

OpenMaple/Java/API

OpenMaple/Java/Engine/evaluate

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam