lidavidm commented on a change in pull request #9751:
URL: https://github.com/apache/arrow/pull/9751#discussion_r597862212



##########
File path: cpp/src/arrow/util/decimal_test.cc
##########
@@ -590,13 +597,62 @@ TEST(TestDecimalFromRealFloat, LargeValues) {
   // Test the entire float range
   for (int32_t scale = -38; scale <= 38; ++scale) {
     float real = std::pow(10.0f, static_cast<float>(scale));
-    CheckDecimalFromRealIntegerString(real, 1, -scale, "1");
+    CheckDecimalFromRealIntegerString<Decimal128>(real, 1, -scale, "1");

Review comment:
       Two things:
   - This apparently fails on Windows MinGW32 due to precision issues.
   - This didn't fail before - something changed. Possibly I do have to figure 
out how to use ASSERT_FLOAT_EQ/ASSERT_DOUBLE_EQ as appropriate.

##########
File path: cpp/src/arrow/util/decimal.cc
##########
@@ -94,6 +94,43 @@ static constexpr double kDoublePowersOfTen[2 * 38 + 1] = {
     1e17,  1e18,  1e19,  1e20,  1e21,  1e22,  1e23,  1e24,  1e25,  1e26,  1e27,
     1e28,  1e29,  1e30,  1e31,  1e32,  1e33,  1e34,  1e35,  1e36,  1e37,  
1e38};
 
+static constexpr float kFloatPowersOfTen76[2 * 76 + 1] = {
+    0,        0,        0,        0,        0,        0,        0,        0,
+    0,        0,        0,        0,        0,        0,        0,        0,
+    0,        0,        0,        0,        0,        0,        0,        0,
+    0,        0,        0,        0,        0,        0,        0,        
1e-45f,
+    1e-44f,   1e-43f,   1e-42f,   1e-41f,   1e-40f,   1e-39f,   1e-38f,   
1e-37f,
+    1e-36f,   1e-35f,   1e-34f,   1e-33f,   1e-32f,   1e-31f,   1e-30f,   
1e-29f,
+    1e-28f,   1e-27f,   1e-26f,   1e-25f,   1e-24f,   1e-23f,   1e-22f,   
1e-21f,
+    1e-20f,   1e-19f,   1e-18f,   1e-17f,   1e-16f,   1e-15f,   1e-14f,   
1e-13f,
+    1e-12f,   1e-11f,   1e-10f,   1e-9f,    1e-8f,    1e-7f,    1e-6f,    
1e-5f,
+    1e-4f,    1e-3f,    1e-2f,    1e-1f,    1e0f,     1e1f,     1e2f,     1e3f,
+    1e4f,     1e5f,     1e6f,     1e7f,     1e8f,     1e9f,     1e10f,    
1e11f,
+    1e12f,    1e13f,    1e14f,    1e15f,    1e16f,    1e17f,    1e18f,    
1e19f,
+    1e20f,    1e21f,    1e22f,    1e23f,    1e24f,    1e25f,    1e26f,    
1e27f,
+    1e28f,    1e29f,    1e30f,    1e31f,    1e32f,    1e33f,    1e34f,    
1e35f,
+    1e36f,    1e37f,    1e38f,    INFINITY, INFINITY, INFINITY, INFINITY, 
INFINITY,

Review comment:
       Looks like INFINITY is actually a double on the Windows R toolchain.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to