NT must be at least model of concept IntegralDomainWithoutDivision.
NT must be a model of concept RealEmbeddable.
#include <CGAL/Quotient.h>
| |||
introduces an uninitialized variable q.
| |||
| |||
| |||
introduces the quotient t/1. NT needs to have a constructor from T.
| |||
| |||
| |||
introduces the quotient NT(t.numerator())/NT(t.denominator()).
NT needs to have a constructor from T.
| |||
| |||
introduces the quotient n/d.
|
There are two access functions, namely to the numerator and the denominator of a quotient. Note that these values are not uniquely defined. It is guaranteed that q.numerator() and q.denominator() return values nt_num and nt_den such that q = nt_num/nt_den, only if q.numerator() and q.denominator() are called consecutively wrt q, i.e. q is not involved in any other operation between these calls.
|
| returns a numerator of q. |
|
| returns a denominator of q. |
The stream operations are available as well. They assume that corresponding stream operators for type NT exist.
The following functions are added to fulfill the Cgal requirements on number types.
|
| returns some double approximation to q. |
|
| returns true, if numerator and denominator are valid. |
|
| returns true, if numerator and denominator are finite. |
|
| returns the square root of q. This is supported if and only if NT supports the square root as well. |