RyanSkraba commented on code in PR #2529:
URL: https://github.com/apache/avro/pull/2529#discussion_r2570807421


##########
lang/java/avro/src/main/java/org/apache/avro/io/JsonEncoder.java:
##########
@@ -208,7 +208,7 @@ public void writeLong(long n) throws IOException {
   @Override
   public void writeFloat(float f) throws IOException {
     parser.advance(Symbol.FLOAT);
-    out.writeNumber(f);
+    out.writeNumber(f + 0d);

Review Comment:
   `Float.toString(33.33000183105469f)` *_is_* "33.33" by definition of 
floating point precision though, right?
   
   Just like `float f = 1.0000000000000000000000001f;`  is a valid decimal 
string representation of a float, but the floating point bits will just think 
`1f`.



-- 
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]

Reply via email to