mirror of https://github.com/CGAL/cgal
added test of double interoperability in arithmetic operators.
This commit is contained in:
parent
a46a1883fa
commit
d2ee3a1eb3
|
|
@ -15,6 +15,8 @@
|
|||
# include <CGAL/leda_integer.h>
|
||||
#endif
|
||||
|
||||
// template class CGAL::Quotient<CGAL::Gmpz>;
|
||||
|
||||
template < typename T >
|
||||
void test_double_ctor()
|
||||
{
|
||||
|
|
@ -26,6 +28,13 @@ void test_double_ctor()
|
|||
assert(q1.numerator() == T(d1));
|
||||
assert(q2.numerator() == 1);
|
||||
assert(q2.denominator() == 2);
|
||||
|
||||
// though not exact, implicit operations +,-,* with double
|
||||
// should be the exactly the same as via explicit ctor!
|
||||
assert( (q1+0.3) == (q1+Qt(0.3)));
|
||||
assert( (q1-0.3) == (q1-Qt(0.3)));
|
||||
assert( (q1*0.3) == (q1*Qt(0.3)));
|
||||
assert( (q1/0.3) == (q1/Qt(0.3)));
|
||||
}
|
||||
|
||||
void test_comparison_operators()
|
||||
|
|
|
|||
Loading…
Reference in New Issue