]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/units/example/unit.cpp
1 // Boost.Units - A C++ library for zero-overhead dimensional analysis and
2 // unit/quantity manipulation and conversion
4 // Copyright (C) 2003-2008 Matthias Christian Schabel
5 // Copyright (C) 2008 Steven Watanabe
7 // Distributed under the Boost Software License, Version 1.0. (See
8 // accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
28 M*(L/T)*(L/T) = m^2 kg s^-2
29 M*(L/T)^2 = m^2 kg s^-2
41 #include "test_system.hpp"
43 #include <boost/units/pow.hpp>
47 using namespace boost::units
;
48 using namespace boost::units::test
;
53 // needs to be namespace-qualified because of global time definition
54 const boost::units::test::time T
;
58 std::cout
<< "L = " << L
<< std::endl
59 << "L+L = " << L
+L
<< std::endl
60 << "L-L = " << L
-L
<< std::endl
61 << "L/L = " << L
/L
<< std::endl
62 << "meter*meter = " << meter
*meter
<< std::endl
63 << "M*(L/T)*(L/T) = " << M
*(L
/T
)*(L
/T
) << std::endl
64 << "M*(L/T)^2 = " << M
*pow
<2>(L
/T
) << std::endl
65 << "L^3 = " << pow
<3>(L
) << std::endl
66 << "L^(3/2) = " << pow
<static_rational
<3,2> >(L
)
68 << "2vM = " << root
<2>(M
) << std::endl
69 << "(3/2)vM = " << root
<static_rational
<3,2> >(M
)