Ian Cook created ARROW-14028:
--------------------------------

             Summary: [R] Cast of NaN to integer should return NA_integer_
                 Key: ARROW-14028
                 URL: https://issues.apache.org/jira/browse/ARROW-14028
             Project: Apache Arrow
          Issue Type: Improvement
          Components: R
            Reporter: Ian Cook


Casting doubleĀ {{NaN}} to integer returns a sentinel value:
{code:r}
call_function("cast", Scalar$create(NaN), options = list(to_type = int32(), 
allow_float_truncate = TRUE))
#> Scalar
#> -2147483648

call_function("cast", Scalar$create(NaN), options = list(to_type = int64(), 
allow_float_truncate = TRUE))
#> Scalar
#> -9223372036854775808{code}
It would be nice if this would instead return {{NA_integer}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to