MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / FindLeadingBit

Method FindLeadingBit

extern/ttmath/ttmathuint.h:608–624  ·  view source on GitHub ↗

! this method looks for the highest set bit result: if 'this' is not zero: return value - true 'table_id' - the index of a word <0..value_size-1> 'index' - the index of this set bit in the word <0..TTMATH_BITS_PER_UINT) if 'this' is zero: return value - false both 'table_id' and 'index' are zero */

Source from the content-addressed store, hash-verified

606 both 'table_id' and 'index' are zero
607 */
608 bool FindLeadingBit(uint & table_id, uint & index) const
609 {
610 for(table_id=value_size-1 ; table_id!=0 && table[table_id]==0 ; --table_id);
611
612 if( table_id==0 && table[table_id]==0 )
613 {
614 // is zero
615 index = 0;
616
617 return false;
618 }
619
620 // table[table_id] is different from 0
621 index = FindLeadingBitInWord( table[table_id] );
622
623 return true;
624 }
625
626
627 /*!

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected