CGAL::Gmpzf

Definition

This is an exact floating-point type; it can represent numbers of the form m*2e, where m is an arbitrary precision integer based on the GNU Multiple Precision Arithmetic Library, and e is of type long. This number type offers functionality very similar to MP_Float but is generally faster.

#include <CGAL/Gmpzf.h>

Is Model for the Concepts

EuclideanRing

RealEmbeddable

Creation

Gmpzf f;
creates a multiple precision floating-point number initialized with 0.


Gmpzf f ( int i);
creates a multiple-precision floating-point number initialized with i.


Gmpzf f ( long int l);
creates a multiple-precision floating-point number initialized with l.


Gmpzf f ( Gmpz i);
creates a multiple-precision floating-point number initialized with i.


Gmpzf f ( double d);
creates a multiple-precision floating-point number initialized with d.

Operations

std::ostream& std::ostream& out << f writes a double approximation of f to the ostream out.

std::ostream& print ( std::ostream& out, f) writes an exact representation of f to the ostream out.

std::istream& std::istream& in >> & f reads a double from in, then converts it to a Gmpzf.

Implementation

The significand m of a Gmpzf is reference counted.