\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.8.2 - Number Types
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
CGAL::Rational_traits< NT > Class Template Reference

#include <CGAL/Rational_traits.h>

Definition

The class Rational_traits can be used to determine the type of the numerator and denominator of a rational number type as Quotient, Gmpq, mpq_class or leda_rational.

Types

typedef unspecified_type RT
 the type of the numerator and denominator.
 

Operations

RT numerator (const NT &r) const
 returns the numerator of r.
 
RT denominator (const NT &r) const
 returns the denominator of r.
 
NT make_rational (const NT &x) const
 returns self.
 
NT make_rational (const std::pair< RT, RT > &p) const
 constructs a rational number p.first/p.second.
 
NT make_rational (const RT &n, const RT &d) const
 constructs a rational number.
 
NT make_rational (const NT &n, const NT &d) const
 constructs a rational number.