Boost C++ Libraries: Ticket #3418: phoenix/starter_kit: broken is_odd https://svn.boost.org/trac10/ticket/3418 <p> is_odd is broken for negative ints. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3418 Trac 1.4.3 Steven Watanabe Tue, 08 Sep 2009 19:36:25 GMT <link>https://svn.boost.org/trac10/ticket/3418#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3418#comment:1</guid> <description> <p> Details: </p> <p> From 5.6 "If both operands are nonnegative then the remainder is nonnegative; if not, the sign of the remainder is implementation-defined." </p> <p> The implementation is </p> <pre class="wiki">bool is_odd(int arg1) { return arg1 % 2 == 1; } </pre><p> The correct test is </p> <pre class="wiki">bool is_odd(int arg1) { return arg1 % 2 != 0; } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Wed, 19 Jan 2011 11:21:34 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3418#comment:2 https://svn.boost.org/trac10/ticket/3418#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> fixed </p> Ticket