pitrou opened a new issue, #35942:
URL: https://github.com/apache/arrow/issues/35942

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   It seems the expected result from converting a decimal to real may be off by 
one ULP:
   ```pycon
   >>> a = pa.array(['999999999999999.9']).cast(pa.decimal128(17,1))
   >>> a
   <pyarrow.lib.Decimal128Array object at 0x7f8ec6f3f6a0>
   [
     999999999999999.9
   ]
   >>> a.cast(pa.float64())
   <pyarrow.lib.DoubleArray object at 0x7f8fa4a88ee0>
   [
     1e+15
   ]
   
   >>> expected = 999999999999999.9
   >>> actual = a.cast(pa.float64())[0].as_py()
   >>> abs(expected-actual)/expected
   1.25e-16
   >>> abs(expected-actual) == expected - math.nextafter(expected, 0)
   True  # Exactly one ULP
   ```
   
   This is much less sever
   
   ### Component(s)
   
   C++


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