<< Elem SYMSCI Toolbox Expand >>

SYMSCI Toolbox >> SYMSCI Toolbox > Evalf

Evalf

evalute to arbitrary precision float

Calling Sequence

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

Arguments

a

symbolic number

bits

non-negative integer

real

boolean

f

symbolic float

Description

Evaluates a symbolic number a to a symbolic 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 symbolic number a is real (%t) or complex (%f).

Examples

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

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

// clean up
reset();
clear pi sqrt2;

See Also

Authors

Bibliography

SymEngine: C++ library for fast symbolic manipulation.


Report an issue
<< Elem SYMSCI Toolbox Expand >>