Conversation
|
Doesn't that just move the issue from encoding to evaluation of the value? |
|
No, purpose of this code is to check whether val |0 equals val(which means whether val is a 32bit integer). Besides, when we are using a long int, zigzag encoding will not reduce the final size as much as encoding a small int. I think it's ok to treat the value as a number(double). |
|
ByteBuffer treat Long values as a special object, encode from a number but decode to a object is bad, I think it's better to keep using number. Treat big number as float will solve my problem. To who do not want precision loss, they can explicit convert value into Long object. |
|
No, I thought wrong. There's no precision loss because number is a double. |
Fix #9