Solve #9 - #10
Conversation
dcodeIO
commented
Sep 20, 2017
Doesn't that just move the issue from encoding to evaluation of the value? |
tdzl2003
commented
Sep 22, 2017
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). |
tdzl2003
commented
Sep 22, 2017
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. |
tdzl2003
commented
Sep 27, 2017
No, I thought wrong. There's no precision loss because number is a double. |
Fix#9