You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Ian Cook (Jira)" <ji...@apache.org> on 2021/09/17 18:58:00 UTC
[jira] [Created] (ARROW-14028) [R] Cast of NaN to integer should
return NA_integer_
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)