Something seems to be wrong with PB/DOS's BIN$() function.
The online help says,
"Numeric expression must be in the range -2,147,483,648 to +2,147,483,647".
But PRINT BIN$(-1&), LEN(BIN$(-1&)) returns the 16-bit(!) value
1111111111111111 16
and not the expected 32-bit value
11111111111111111111111111111111 32
which is fatal, as
CLNG(&B00000000000000001111111111111111) evaluates to 65535 and
CLNG(&B11111111111111111111111111111111) evaluates to -1.
Is this a bug or did I misunderstand something?
Thank you for your replies.
Heinz Salomon
------------------
The online help says,
"Numeric expression must be in the range -2,147,483,648 to +2,147,483,647".
But PRINT BIN$(-1&), LEN(BIN$(-1&)) returns the 16-bit(!) value
1111111111111111 16
and not the expected 32-bit value
11111111111111111111111111111111 32
which is fatal, as
CLNG(&B00000000000000001111111111111111) evaluates to 65535 and
CLNG(&B11111111111111111111111111111111) evaluates to -1.
Is this a bug or did I misunderstand something?
Thank you for your replies.
Heinz Salomon
------------------
Comment