// TODO: Add licence // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // // $URL$ // $Id$ // // Author(s) : Michael Hemmer // // within this file FT ^= Fraction_traits #include #include #include #ifndef CGAL_TEST_RATIONAL_TRAITS_H #define CGAL_TEST_RATIONAL_TRAITS_H CGAL_BEGIN_NAMESPACE template void test_rational_traits(){ Rational x = Rational(7)/Rational(2); typedef Rational_traits Rational_traits; typedef typename Rational_traits::RT RT; BOOST_STATIC_ASSERT((::boost::is_same::value)); assert( Rational_traits().numerator(x) == RT(7)); assert( Rational_traits().denominator(x) == RT(2)); assert( Rational_traits().make_rational(RT(7),RT(2)) == x); assert( Rational_traits().make_rational(x,x) == Rational(1)); // gloabal function to_rational x = CGAL::to_rational(3.5); assert( x == Rational(7)/Rational(2)); } CGAL_END_NAMESPACE #endif // CGAL_TEST_RATIONAL_TRAITS_H