pitrou commented on code in PR #44906:
URL: https://github.com/apache/arrow/pull/44906#discussion_r1875539771


##########
cpp/src/arrow/util/string_builder.h:
##########
@@ -46,7 +47,12 @@ class ARROW_EXPORT StringStreamWrapper {
 
 template <typename Head>
 void StringBuilderRecursive(std::ostream& stream, Head&& head) {
-  stream << head;
+  if constexpr (std::is_floating_point_v<std::decay_t<Head>>) {
+    // Avoid losing precision when printing floating point numbers
+    stream << std::to_string(head);

Review Comment:
   `arrow::util::StringBuilder` is mostly used for building error messages 
(while casting Arrow data to string, for example, uses our own formatting 
routines). So I wouldn't consider this a breaking change.



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