[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strange bitshift behavior?
From: |
Andreas Romeyke |
Subject: |
Re: Strange bitshift behavior? |
Date: |
Tue, 22 May 2007 15:29:45 +0200 |
User-agent: |
IceDove 1.5.0.10 (X11/20070329) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
address@hidden schrieb:
> In Octave and Matlab bitshift (-100, -4) brings -6 !!! What's the
> different?
>
"help bitshift" helps: " C = BITSHIFT(A,K) returns the value of A
shifted by K bits. A must be
an unsigned integer or an array of unsigned integers"
and
" Return a K bit shift of N- digit unsigned integers in A".
If you want to use bitshift() for signed integers, you should convert
them into unsigned first.
Bye Andreas
- --
Software Developer / Dipl. Inform. (FH)
Max Planck Institute for Human Cognitive and Brain Sciences
Department of Psychology
Stephanstr. 1a, 04103 Leipzig, Germany
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGUvBJGBhgJGthyeERAhWAAJ98GoH7QT8ro7zubOu0Vo7EIGu6CwCffAEX
hD71AiEKpQKI98pmkPHLzgM=
=dQ5u
-----END PGP SIGNATURE-----