[Gambas-user] Maybe (still) a bug in bit manipulation functions

Leonardo Miliani leonardo at ...1237...
Mon Mar 30 15:09:21 CEST 2009


Benoît Minisini ha scritto:
>> It seems that there are bugs in the "Ror" function too.
>> Using the same number, 197 (11000101), if I write ROR(197,3) I get
>> -1610612712 (
>> 1111111111111111111111111111111110100000000000000000000000011000)
>> instead of 10111000 (184).
> 
> 197 is not a Byte, it is an Integer. If you want a Byte, you have to do 
> Shl(CByte(197), 3).
> 
> Regards,
> 

Sorry.
I was thinking that the function would find the type of the data by itself.

-- 
Ciao.
Leo.

Web: www.leonardomiliani.com
E-mail: leonardo at ...1237...
Scegli software opensource - Choose opensource software

Co-fondatore di Gambas-it.org
Il sito di riferimento della comunità italiana degli utenti di Gambas
www.gambas-it.org




More information about the User mailing list