You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Ryan McKinley <ry...@gmail.com> on 2008/06/06 21:10:53 UTC
Re: svn commit: r664083 - /lucene/solr/trunk/src/test/org/apache/solr/util/TestUtils.java
>
> + num = 234;
> + //????? why 1?
> + // assertEquals( 0, BitUtil.ntz(num) );
> + // assertEquals( 0, BitUtil.ntz2(num) );
> + // assertEquals( 0, BitUtil.ntz3(num) );
> + }
Any idea why the answer is 1? the docs say "(only works for x!=0)"
Re: svn commit: r664083 - /lucene/solr/trunk/src/test/org/apache/solr/util/TestUtils.java
Posted by Yonik Seeley <yo...@apache.org>.
On Fri, Jun 6, 2008 at 3:10 PM, Ryan McKinley <ry...@gmail.com> wrote:
>>
>> + num = 234;
>> + //????? why 1?
>> + // assertEquals( 0, BitUtil.ntz(num) );
>> + // assertEquals( 0, BitUtil.ntz2(num) );
>> + // assertEquals( 0, BitUtil.ntz3(num) );
>> + }
>
> Any idea why the answer is 1? the docs say "(only works for x!=0)"
ntz is for binary bits (the other test cases just happen to be the
same in binary and decimal - pretty funny).
Anyway 234 in binary is 11101010 (1 trailing zero)
-Yonik