struggling with integers (maximum integer size)

前端 未结 4 860
野性不改
野性不改 2020-11-29 08:52

I was using a function that requires input as integers.

So I have been trying to read up on making things integers:

y <- 3.14
as.integer(y)
[1] 3          


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 09:33

    Update to Dason's answer (don't have enough reputation to make a comment):

    The int64 package has now been deprecated, however there is now a package called bit64. I was able to achieve the same result using it. The syntax changed only slightly from "as.int64" to "as.integer64".

    I.e.

    library(bit64)
    as.integer64(.Machine$integer.max) + 1L
    

提交回复
热议问题