4 ms·
idk anything about Java but I imagine the spec could define this to be positive
by xhgdvjky 7y ago
idk anything about Java but I imagine the spec could define this to be positive
- LeifCarrotson 7y agoIf the spec was going to define it to be positive, the function would not return 'long', it would be unsigned long, right?
- arnsholt 7y agoJava doesn't have unsigned integer types (except byte IIRC), so signed long is your only option. OTOH the bitwise ops are specced to operate as if they operated on twos complement represented signed integers, so you can at least do that kind of stuff if you need to, on the full 64 bits.
- ddtaylor 7y agobyte is signed, just FYI