Donot希望在R中完成大数字

时间:2015-07-28 20:55:09

标签: r console rounding numeric

options(scipen=999)

625075741017804800

625075741017804806

当我在R控制台中键入以上内容时,我得到上面列出的两个数字的相同输出。输出为:625075741017804800

我该如何避免?

2 个答案:

答案 0 :(得分:6)

大于2 ^ 53的数字不会明确地存储在R数字分类向量中。最近有一个更改允许数字横坐标中的整数存储,但是你的数字大于增加精度容量:

625075741017804806 > 2^53
[1] TRUE

在更改之前,整数只能存储到Machine$integer.max == 2147483647。大于该值的数字会被静默强制转换为“数字”类。您将需要使用字符值来处理它们或安装能够实现任意精度的包。 Rmpfrgmp是我想到的两个。

答案 1 :(得分:2)

您可以将包Caught "NSInternalInconsistencyException" with reason "User cannot be saved unless they have been authenticated via logIn or signUp": ( 0 CoreFoundation 0x000000018514c2f4 <redacted> + 160 1 libobjc.A.dylib 0x00000001969180e4 objc_exception_throw + 60 2 CoreFoundation 0x000000018514c218 <redacted> + 0 3 0x00000001004bc980 -[PFUser(Private) _checkSaveParametersWithCurrentUser:] + 380 4 0x0000000100466f3c __65+[PFObject(Private) _deepSaveAsync:withCurrentUser:sessionToken:]_block_invoke_3 + 412 5 0x000000010062e628 __41-[BFTask continueWithExecutor:withBlock:]_block_invoke_2 + 32 6 libdispatch.dylib 0x00000001010d8fd4 _dispatch_call_block_and_release + 24 7 libdispatch.dylib 0x00000001010d8f94 _dispatch_client_callout + 16 8 libdispatch.dylib 0x00000001010e6b54 _dispatch_root_queue_drain + 2180 9 libdispatch.dylib 0x00000001010e8248 _dispatch_worker_thread3 + 132 10 libsystem_pthread.dylib 0x000000019714922c _pthread_wqthread + 816 11 libsystem_pthread.dylib 0x0000000197148ef0 start_wqthread + 4 ). 用于任意精度

Rmpfr