3 <title>BOOST_PP_DIV_D
</title>
4 <link rel=
"stylesheet" type=
"text/css" href=
"../styles.css">
7 <div style=
"margin-left: 0px;">
8 The
<b>BOOST_PP_DIV_D
</b> macro expands to the quotient of its second and third arguments.
9 It reenters
<b>BOOST_PP_WHILE
</b> with maximum efficiency.
13 <b>BOOST_PP_DIV_D
</b>(
<i>d
</i>,
<i>x
</i>,
<i>y
</i>)
19 The next available
<b>BOOST_PP_WHILE
</b> iteration.
23 The dividend (numerator) of the operation.
24 Valid values range from
<i>0</i> to
<b>BOOST_PP_LIMIT_MAG
</b>.
28 The divisor (denominator) of the operation.
29 Valid values range from
<i>1</i> to
<b>BOOST_PP_LIMIT_MAG
</b>.
34 If
<i>y
</i> is
<i>0</i>, the result is undefined.
38 <li><a href=
"div.html">BOOST_PP_DIV
</a></li>
39 <li><a href=
"limit_mag.html">BOOST_PP_LIMIT_MAG
</a></li>
43 <b>Header:
</b> <a href=
"../headers/arithmetic/div.html"><boost/preprocessor/arithmetic/div.hpp
></a>
47 #include
<<a href=
"../headers/arithmetic/dec.html">boost/preprocessor/arithmetic/dec.hpp
</a>>
48 #include
<<a href=
"../headers/arithmetic/div.html">boost/preprocessor/arithmetic/div.hpp
</a>>
49 #include
<<a href=
"../headers/control/while.html">boost/preprocessor/control/while.hpp
</a>>
50 #include
<<a href=
"../headers/tuple/elem.html">boost/preprocessor/tuple/elem.hpp
</a>>
52 #define PRED(d, data)
<a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
0, data)
56 <a href=
"dec.html">BOOST_PP_DEC
</a>( \
57 <a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
0, data) \
59 <a href=
"div_d.html">BOOST_PP_DIV_D
</a>( \
61 <a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
1, data), \
67 // halve 'x' 'n' times
68 #define HALVE(x, n)
<a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
1,
<a href=
"while.html">BOOST_PP_WHILE
</a>(PRED, OP, (n, x)))
70 HALVE(
8,
2) // expands to
2
71 HALVE(
16,
1) // expands to
8
74 <div style=
"margin-left: 0px;">
75 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
76 </br><i>© Copyright Paul Mensonides
2002</i>
78 <div style=
"margin-left: 0px;">
79 <p><small>Distributed under the Boost Software License, Version
1.0. (See
80 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
82 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>