Antonio Linares wrote:Christiano,
? hb_NumToHex( 6736896 ) => 0x66CC00 (hexadecimal)
? hb_NumToHex( hb_bitAnd( 6736896, 0xFF0000 ) / 0xFF00 )
? hb_NumToHex( hb_bitAnd( 6736896, 0x00FF00 ) / 0x00FF )
? hb_NumToHex( hb_bitAnd( 6736896, 0x0000FF ) )
I must disagree, the correct formulas are:
? hb_NumToHex( hb_bitAnd( 6736896, 0x
FF0000 ) / 0x10000 )
? hb_NumToHex( hb_bitAnd( 6736896, 0x00
FF00 ) / 0x100 )
? hb_NumToHex( hb_bitAnd( 6736896, 0x0000
FF ) )
or better
? hb_NumToHex( hb_bitShift( hb_bitAnd( 6736896, 0x
FF0000 ) ,-16) )
? hb_NumToHex( hb_bitShift( hb_bitAnd( 6736896, 0x00
FF00 ) ,-8) )
? hb_NumToHex( hb_bitAnd( 6736896, 0x0000
FF ) )