<< Div SYMSCI Toolbox Exp >>

SYMSCI Toolbox >> SYMSCI Toolbox > Evalf

Evalf

evalute to arbitrary precision float

Syntax

f = Evalf( a, bits, real = %t )

Arguments

a

symbolic

bits

non-negative integer

real

boolean

f

symbolic

Description

Evaluates a number a to a floating point number f with arbitrary precision.

The number of significant bits specifies the precision. For bits<=53 always standard double precision is used.

The flag real specifies whether the number a is real (%t) or complex (%f).

Examples

// create some numbers
pi    = Sym("pi");
sqrt2 = Sym("sqrt(-2)");

// evalute to float with 60 decimal digits of precision,
// thus we use ceil(60*(log(10)/log(2))) = 200 bits of precision
Evalf( pi, 200 )
Evalf( sqrt2, 200, %f )

See Also

Authors

Bibliography

SymEngine: C++ library for fast symbolic manipulation.


Report an issue
<< Div SYMSCI Toolbox Exp >>