Fixed and Arbitrary Precision Numerical Fields#
Floating-Point Arithmetic#
Sage supports arbitrary precision real (RealField) and complex fields (ComplexField). Sage also provides two optimized fixed precision fields for numerical computation, the real double (RealDoubleField) and complex double fields (ComplexDoubleField).
Real and complex double elements are optimized implementations that use the GNU Scientific Library for arithmetic and some special functions. Arbitrary precision real and complex numbers are implemented using the MPFR library, which builds on GMP. In many cases the PARI C-library is used to compute special functions when implementations aren’t otherwise available.
- Arbitrary Precision Real Numbers
QQtoRR
RRtoRR
RealField()
RealField_class
RealLiteral
RealNumber
ZZtoRR
create_RealField()
create_RealNumber()
double_toRR
int_toRR
is_RealField()
is_RealNumber()
mpfr_get_exp_max()
mpfr_get_exp_max_max()
mpfr_get_exp_min()
mpfr_get_exp_min_min()
mpfr_prec_max()
mpfr_prec_min()
mpfr_set_exp_max()
mpfr_set_exp_min()
- Arbitrary Precision Floating Point Complex Numbers
- Arbitrary Precision Complex Numbers using GNU MPC
- Double Precision Real Numbers
- Double Precision Complex Numbers
Interval Arithmetic#
Sage implements real and complex interval arithmetic using MPFI (RealIntervalField, ComplexIntervalField) and arb (RealBallField, ComplexBallField).