in reply to Re: Decimal to Hexadecimal conversion and extraction MSB
in thread Decimal to Hexadecimal conversion and extraction MSB
extracts the leftmost bit of a 16 bit integer, not the leftmost '1' bit of any length integer, which is what was asked (I think).my $msb = $decimal_number & 0x8000;
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Decimal to Hexadecimal conversion and extraction MSB
by eye (Chaplain) on Oct 17, 2009 at 09:09 UTC |