Close
Close window
toBigDecimal - 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.toBigDecimal

return the value of the Numeric object as a Java BigDecimal

Calling Sequence

java.math.BigDecimal toBigDecimal() throws MapleException

Description

The toBigDecimal function returns the value represented in the Numeric as a Java BigDecimal.

The java.math.BigDecimal format can represent arbitrary-precision floating-point numbers, but not NaN or infinite quantities. If the value is NaN or infinite, an error is raised.

Examples

import java.math.BigDecimal;

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( "evalf[60](Pi):" );

System.out.println( n );

BigDecimal bd = n.toBigDecimal();

System.out.println( bd );

}

}

Executing this code produces the following output.

3.14159265358979323846264338327950288419716939937510582097494

3.14159265358979323846264338327950288419716939937510582097494

Compatibility

The Numeric.toBigDecimal command was introduced in Maple 2018.

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


Download Help Document

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