> Great! it's easy!
>
> Thanks very much!
>
> On Sat, 2010-11-20 at 18:30 +0200, Jussi Lahtinen wrote:
> > because lsr processes 32 bits of the short -9 and not 64 bits of the
> >
> > > long binary number?
> >
> > Yes, -9 is considered as short.
> > Try:
> > ? bin(lsr(clng(-9),1), 64)
> > 0111111111111111111111111111111111111111111111111111111111111011
> >
> > Jussi
Bit manipulation functions work on the number of bits defined by their
argument: Byte -> 8, Short -> 16, Integer (the default for numeric values) ->
32, Long -> 64.
So Lsr(-9, 1), which does not keep the sign of its argument, does that:
11111111111111111111111111110111
-> 01111111111111111111111111111011
But Bin$() always print 64 binary digits for negative numbers, so you think
that it was wrong.
Regards,
--
Benoît Minisini
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user