! 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 */
| 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 | /*! |
no outgoing calls
no test coverage detected