• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //  Copyright 2011 Vicente J. Botet Escriba
2 //  Distributed under the Boost Software License, Version 1.0.
3 //  See http://www.boost.org/LICENSE_1_0.txt
4 
5 // test ratio:  equivalent ratios convert with BOOST_RATIO_EXTENSIONS
6 
7 #define BOOST_RATIO_EXTENSIONS
8 #include <boost/ratio/ratio.hpp>
9 #include <boost/core/lightweight_test.hpp>
10 
11 boost::intmax_t func(boost::ratio<5,6>  s);
12 
func(boost::ratio<5,6> s)13 boost::intmax_t func(boost::ratio<5,6>  s) {
14     return s.num;
15 }
16 
17 void test();
18 
test()19 void test() {
20     boost::ratio<10,12> r;
21     BOOST_TEST((
22         func(r)==5
23     ));
24 }
25 
main()26 int main()
27 {
28     test();
29     return boost::report_errors();
30 }
31