#include <CGAL/Quotient.h>
| |
introduces an uninitialized variable q.
| |
| |
introduces the quotient i/1.
| |
| |
introduces the quotient n/1.
| |
| |
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.
|
| writes q to ostream out in format ``n/d'', where nq.numerator() and d q.denominator(). |
|
| |
reads q from istream in. Expected format is ``n/d '', where n and d are of type NT. A single n which is not followed by a / is also accepted and interpreted as n/1. |
The following functions are added to fulfill the CGAL requirements on number types.