Difference parsing from String and byte literal
carsten.zerbst at groy-groy.de
carsten.zerbst at groy-groy.de
Sat Apr 9 12:59:34 PDT 2011
Hello,
I played a little with the new JDK7 and run into a inconsistency with
existing code.
So far I use the following code to represent a mask
long SOURCE_ENTITY_TYPE_MASK = Long.parseLong("10000000" + //
"00000000" + //
"00000000" + //
"10000000", 2);
Ok, the shiny new version would be
long coin = 0b10000000_00000000_00000000_10000000;
But if one print the decimal and binary representation one gets a difference
from String 2147483776
from String 10000000000000000000000010000000
binary -2147483520
binary 1111111111111111111111111111111110000000000000000000000010000000
This is no problem for my mask but should perhaps be mentioned in the
tutorial ?
Bye, Carsten
More information about the coin-dev
mailing list