Processing math: 100%
 
CGAL 6.1 - Number Types
All Classes Namespaces Functions Typedefs Pages
Loading...
Searching...
No Matches
CGAL::Gmpzf Class Reference

#include <CGAL/Gmpzf.h>

Definition

An object of the class Gmpzf is a multiple-precision floating-point number which can represent numbers of the form m*2^e, where m is an arbitrary precision integer based on the GMP library, and e is of type long.

This type can be considered exact, even if the exponent is not a multiple-precision number. This number type offers functionality very similar to MP_Float but is generally faster.

Is model of
EuclideanRing
RealEmbeddable

Implementation

The significand m of a Gmpzf is a Gmpz and is reference counted. The exponent e of a Gmpzf is a long.

Related Symbols

(Note that these are not member symbols.)

std::ostream & operator<< (std::ostream &out, const Gmpzf &f)
 writes a double approximation of f to the ostream out.
 
std::ostream & print (std::ostream &out, const Gmpzf &f)
 writes an exact representation of f to the ostream out.
 
std::istream & operator>> (std::istream &in, Gmpzf &f)
 reads a double from in, then converts it to a Gmpzf.
 

Creation

 Gmpzf ()
 creates a Gmpzf initialized with 0.
 
 Gmpzf (int i)
 creates a Gmpzf initialized with i.
 
 Gmpzf (long int l)
 creates a Gmpzf initialized with l.
 
 Gmpzf (const Gmpz &i)
 creates a Gmpzf initialized with i.
 
 Gmpzf (const Gmpfr &f)
 creates a Gmpzf initialized with f.
 
 Gmpzf (double d)
 creates a Gmpzf initialized with d.
 

Constructor & Destructor Documentation

◆ Gmpzf() [1/6]

CGAL::Gmpzf::Gmpzf ( )

creates a Gmpzf initialized with 0.

◆ Gmpzf() [2/6]

CGAL::Gmpzf::Gmpzf ( int  i)

creates a Gmpzf initialized with i.

◆ Gmpzf() [3/6]

CGAL::Gmpzf::Gmpzf ( long int  l)

creates a Gmpzf initialized with l.

◆ Gmpzf() [4/6]

CGAL::Gmpzf::Gmpzf ( const Gmpz i)

creates a Gmpzf initialized with i.

◆ Gmpzf() [5/6]

CGAL::Gmpzf::Gmpzf ( const Gmpfr f)

creates a Gmpzf initialized with f.

◆ Gmpzf() [6/6]

CGAL::Gmpzf::Gmpzf ( double  d)

creates a Gmpzf initialized with d.

Friends And Related Symbol Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const Gmpzf f 
)
related

writes a double approximation of f to the ostream out.

◆ operator>>()

std::istream & operator>> ( std::istream &  in,
Gmpzf f 
)
related

reads a double from in, then converts it to a Gmpzf.

◆ print()

std::ostream & print ( std::ostream &  out,
const Gmpzf f 
)
related

writes an exact representation of f to the ostream out.