Re: bit shift



Wai Au wrote:
On Feb 2, 3:17 pm, Wai Au <always...@xxxxxxxxx> wrote:
in 8.4, expr 38016 << 16 returns -1803550720. In 8.5, the same
expression returns 2491416576. Is there a way to get the negative
value in 8.5?

ok, i got it. scan [expr 38016 << 16] %i returns the signed value.

Beware. Neither that, nor your original command is portable to
64-bit systems.

--
| Don Porter Applied and Computational Mathematics Division |
| donald.porter@xxxxxxxx Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
.