So, bit64::as.integer64.character can be useful, since precision is not lost when you type it or read it in as a string:bit64::as.integer64("-8664354335142704128")# integer64# [1] -8664354335142704128bit64::as.integer64("-8664354335142704128") == bit64::as.integer64("-8664354335142703762")# [1] FALSE 仅供参考,您的号码已经接近 64 位边界:FYI, your number is already near the 64-bit boundary:-.Machine$integer.max# [1] -2147483647-(2^31-1)# [1] -2147483647log(8664354335142704128, 2)# [1] 62.9098-2^63 # the approximate +/- range of 64-bit integers# [1] -9.223372e+18-8664354335142704128# [1] -8.664354e+18 这篇关于R:如何将长数字转换为字符串以节省精度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-14 04:09