Close
Close window
toBigInteger - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

Numeric.toBigInteger

return the value of the Numeric object as a Java BigInteger

Calling Sequence

java.math.BigInteger toBigInteger() throws MapleException

Description

The toBigInteger function returns the value represented in the Numeric as a Java BigInteger.

The java.math.BigInteger format can represent arbitrary-precision integers. If the value is not an integer, an error is raised.

To determine if the value is an integer, use the isInteger function.

Examples

import java.math.BigInteger;

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 );

Numeric n = (Numeric)engine.evaluate( "2^66:" );

System.out.println( n );

System.out.println( n.isLong() );

BigInteger bd = n.toBigInteger();

System.out.println( bd );

}

}

Executing this code produces the following output.

302231454903657293676544

false

302231454903657293676544

Compatibility

The Numeric.toBigInteger command was introduced in Maple 2018.

For more information on Maple 2018 changes, see Updates in Maple 2018 .


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /