return the real component of the ComplexNumeric object - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Programming : OpenMaple : Java Application Programming Interface : ComplexNumeric Class : OpenMaple/Java/ComplexNumeric/realPart

ComplexNumeric.realPart - return the real component of the ComplexNumeric object

Calling Sequence

Numeric realPart() throws MapleException



The realPart function returns a Numeric object, which represents the real component of the ComplexNumeric.


To access the imaginary component of the ComplexNumeric, use the imaginaryPart method.


import com.maplesoft.openmaple.*;

import com.maplesoft.externalcall.MapleException;

class Example


    public static void main( String notused[] ) throws MapleException


    String mapleArgs[];

    Engine engine;

    ComplexNumeric n1;

    Numeric re;

    mapleArgs = new String[1];

    mapleArgs[0] = "java";

    engine = new Engine( mapleArgs, new EngineCallBacksDefault(),

        null, null );

    n1 = (ComplexNumeric)engine.evaluate( "10+20*I:" );

    System.out.println( n1 );

    re = n1.realPart();

    System.out.println( re );



Executing this code produces the following output.



See Also

ExternalCalling/Java/MapleException, OpenMaple, OpenMaple/Java/API, OpenMaple/Java/ComplexNumeric, OpenMaple/Java/ComplexNumeric/imaginaryPart, OpenMaple/Java/Numeric

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