1// Boost.Units - A C++ library for zero-overhead dimensional analysis and
2// unit/quantity manipulation and conversion
3//
4// Copyright (C) 2003-2008 Matthias Christian Schabel
5// Copyright (C) 2007-2008 Steven Watanabe
6//
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)
10
11#ifndef BOOST_UNITS_SI_PREFIXES_HPP
12#define BOOST_UNITS_SI_PREFIXES_HPP
13
14#include <boost/units/static_constant.hpp>
15
16#include <boost/units/make_scaled_unit.hpp>
17#include <boost/units/systems/si/dimensionless.hpp>
18
19namespace boost {
20
21namespace units {
22
23namespace si {
24
25#define BOOST_UNITS_METRIC_PREFIX(exponent, name) \
26 typedef make_scaled_unit<dimensionless, scale<10, static_rational<exponent> > >::type name ## _type;\
27 BOOST_UNITS_STATIC_CONSTANT(name, name ## _type)
28
29BOOST_UNITS_METRIC_PREFIX(-24, yocto);
30BOOST_UNITS_METRIC_PREFIX(-21, zepto);
31BOOST_UNITS_METRIC_PREFIX(-18, atto);
32BOOST_UNITS_METRIC_PREFIX(-15, femto);
33BOOST_UNITS_METRIC_PREFIX(-12, pico);
34BOOST_UNITS_METRIC_PREFIX(-9, nano);
35BOOST_UNITS_METRIC_PREFIX(-6, micro);
36BOOST_UNITS_METRIC_PREFIX(-3, milli);
37BOOST_UNITS_METRIC_PREFIX(-2, centi);
38BOOST_UNITS_METRIC_PREFIX(-1, deci);
39BOOST_UNITS_METRIC_PREFIX(1, deka);
40BOOST_UNITS_METRIC_PREFIX(2, hecto);
41BOOST_UNITS_METRIC_PREFIX(3, kilo);
42BOOST_UNITS_METRIC_PREFIX(6, mega);
43BOOST_UNITS_METRIC_PREFIX(9, giga);
44BOOST_UNITS_METRIC_PREFIX(12, tera);
45BOOST_UNITS_METRIC_PREFIX(15, peta);
46BOOST_UNITS_METRIC_PREFIX(18, exa);
47BOOST_UNITS_METRIC_PREFIX(21, zetta);
48BOOST_UNITS_METRIC_PREFIX(24, yotta);
49
50/*BOOST_UNITS_STATIC_CONSTANT(yocto,long double) = (1e-24); ///< metric prefix for 1.0e-24
51BOOST_UNITS_STATIC_CONSTANT(zepto,long double) = (1e-21); ///< metric prefix for 1.0e-21
52BOOST_UNITS_STATIC_CONSTANT(atto,long double) = (1e-18); ///< metric prefix for 1.0e-18
53BOOST_UNITS_STATIC_CONSTANT(femto,long double) = (1e-15); ///< metric prefix for 1.0e-15
54BOOST_UNITS_STATIC_CONSTANT(pico,long double) = (1e-12); ///< metric prefix for 1.0e-12
55BOOST_UNITS_STATIC_CONSTANT(nano,long double) = (1e-9); ///< metric prefix for 1.0e-9
56BOOST_UNITS_STATIC_CONSTANT(micro,long double) = (1e-6); ///< metric prefix for 1.0e-6
57BOOST_UNITS_STATIC_CONSTANT(milli,long double) = (1e-3); ///< metric prefix for 1.0e-3
58BOOST_UNITS_STATIC_CONSTANT(centi,long double) = (1e-2); ///< metric prefix for 1.0e-2
59BOOST_UNITS_STATIC_CONSTANT(deci,long double) = (1e-1); ///< metric prefix for 1.0e-1
60BOOST_UNITS_STATIC_CONSTANT(deka,long double) = (1e1); ///< metric prefix for 1.0e+1
61BOOST_UNITS_STATIC_CONSTANT(hecto,long double) = (1e2); ///< metric prefix for 1.0e+2
62BOOST_UNITS_STATIC_CONSTANT(kilo,long double) = (1e3); ///< metric prefix for 1.0e+3
63BOOST_UNITS_STATIC_CONSTANT(mega,long double) = (1e6); ///< metric prefix for 1.0e+6
64BOOST_UNITS_STATIC_CONSTANT(giga,long double) = (1e9); ///< metric prefix for 1.0e+9
65BOOST_UNITS_STATIC_CONSTANT(tera,long double) = (1e12); ///< metric prefix for 1.0e+12
66BOOST_UNITS_STATIC_CONSTANT(peta,long double) = (1e15); ///< metric prefix for 1.0e+15
67BOOST_UNITS_STATIC_CONSTANT(exa,long double) = (1e18); ///< metric prefix for 1.0e+18
68BOOST_UNITS_STATIC_CONSTANT(zetta,long double) = (1e21); ///< metric prefix for 1.0e+21
69BOOST_UNITS_STATIC_CONSTANT(yotta,long double) = (1e24); ///< metric prefix for 1.0e+24 */
70
71} // namespace si
72
73} // namespace units
74
75} // namespace boost
76
77#endif // BOOST_UNITS_SI_PREFIXES_HPP
78

source code of boost/libs/units/include/boost/units/systems/si/prefixes.hpp