3 <title>BOOST_PP_MOD_D
</title>
4 <link rel=
"stylesheet" type=
"text/css" href=
"../styles.css">
7 <div style=
"margin-left: 0px;">
8 The
<b>BOOST_PP_MOD_D
</b> macro expands to the modulus of its second and third arguments.
9 It reenters
<b>BOOST_PP_WHILE
</b> with maximum efficiency.
13 <b>BOOST_PP_MOD_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=
"limit_mag.html">BOOST_PP_LIMIT_MAG
</a></li>
39 <li><a href=
"mod.html">BOOST_PP_MOD
</a></li>
43 <b>Header:
</b> <a href=
"../headers/arithmetic/div.html"><boost/preprocessor/arithmetic/div.hpp
></a>
47 #include
<<a href=
"../headers/arithmetic/mod.html">boost/preprocessor/arithmetic/mod.hpp
</a>>
48 #include
<<a href=
"../headers/list/filter.html">boost/preprocessor/list/filter.hpp
</a>>
49 #include
<<a href=
"../headers/logical/not.html">boost/preprocessor/logical/not.hpp
</a>>
51 #define LIST (
1, (
2, (
3, (
4, (
5,
<a href=
"nil.html">BOOST_PP_NIL
</a>)))))
53 #define EVEN_P(d, _, num)
<a href=
"not.html">BOOST_PP_NOT
</a>(
<a href=
"mod_d.html">BOOST_PP_MOD_D
</a>(d, num,
2))
54 #define EVEN(list)
<a href=
"list_filter.html">BOOST_PP_LIST_FILTER
</a>(EVEN_P, nil, list)
56 EVEN(LIST) // expands to (
2, (
4,
<a href=
"nil.html">BOOST_PP_NIL
</a>))
58 #define ODD_P(d, _, num)
<a href=
"mod_d.html">BOOST_PP_MOD_D
</a>(d, num,
2)
59 #define ODD(list)
<a href=
"list_filter.html">BOOST_PP_LIST_FILTER
</a>(ODD_P, nil, list)
61 ODD(LIST) // expands to (
1, (
3, (
5,
<a href=
"nil.html">BOOST_PP_NIL
</a>)))
64 <div style=
"margin-left: 0px;">
65 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
66 </br><i>© Copyright Paul Mensonides
2002</i>
68 <div style=
"margin-left: 0px;">
69 <p><small>Distributed under the Boost Software License, Version
1.0. (See
70 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
72 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>