jt2594838 commented on code in PR #412:
URL: https://github.com/apache/tsfile/pull/412#discussion_r1959440771
##########
java/tsfile/src/main/java/org/apache/tsfile/encoding/encoder/FloatEncoder.java:
##########
@@ -137,8 +136,13 @@ private int convertFloatToInt(float value) {
private long convertDoubleToLong(double value) {
if (value * maxPointValue > Long.MAX_VALUE || value * maxPointValue <
Long.MIN_VALUE) {
- underflowFlags.add(false);
- return Math.round(value);
+ if (value > Long.MAX_VALUE || value < Long.MIN_VALUE) {
+ underflowFlags.add(null);
+ return Double.doubleToLongBits(value);
Review Comment:
Should also consider NaN.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]