Getting wrong plural from calculation
<pre><code>$n=21;
$p=$n%10==1 &amp;&amp; $n%100!=11 ? 0 : $n%10&gt;=2 &amp;&amp; $n%10&lt;=4 &amp;&amp; ($n%100&lt;10 || $n%100&gt;=20) ? 1 : 2;
</code></pre>

<p>why is $p = 2?
it is supposed to be $p = 0!
is it a bug or am I missing something?</p>

<p>I got this from trying to get the plural form for Russian on: <a href="http://www.gnu.org/s/hello/manual/gettext/Plural-forms.html" rel="nofollow">http://www.gnu.org/s/hello/manual/gettext/Plural-forms.html</a></p>
