andygrove commented on code in PR #4924:
URL: https://github.com/apache/datafusion-comet/pull/4924#discussion_r3603855056


##########
native/spark-expr/src/conversion_funcs/numeric.rs:
##########
@@ -1424,5 +1495,14 @@ mod tests {
         assert_eq!(fmt(1, -2), "1E+2");
         assert_eq!(fmt(123, -2), "1.23E+4");
         assert_eq!(fmt(-123, -2), "-1.23E+4");
+
+        // values needing more than one 64-bit digit group
+        assert_eq!(fmt(10_000_000_000_000_000_000, 0), "10000000000000000000");
+        assert_eq!(fmt(i128::MAX, 0), i128::MAX.to_string());
+        assert_eq!(fmt(i128::MIN, 0), i128::MIN.to_string());
+        assert_eq!(
+            fmt(99_999_999_999_999_999_999_999_999_999_999_999_999, 10),
+            "9999999999999999999999999999.9999999999"

Review Comment:
   Added `fmt(i128::MAX, 45)` and `fmt(-i128::MAX, 45)` (both in scientific 
notation on a two-group coefficient), which exercise the sign push and the 
`&coeff[..1]` / `&coeff[1..]` split.



##########
native/spark-expr/src/conversion_funcs/numeric.rs:
##########
@@ -1424,5 +1495,14 @@ mod tests {
         assert_eq!(fmt(1, -2), "1E+2");
         assert_eq!(fmt(123, -2), "1.23E+4");
         assert_eq!(fmt(-123, -2), "-1.23E+4");
+
+        // values needing more than one 64-bit digit group
+        assert_eq!(fmt(10_000_000_000_000_000_000, 0), "10000000000000000000");

Review Comment:
   Added `fmt(10_000_000_000_000_000_005, 0)` covering the render_digits 
"leading zeros in a non-top group" case that the code comment calls out.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to