首页 > 解决方案 > R Limitation? A + B - A = B

问题描述

enter image description here

This is the image.

So basically a + b - a is supposed to be b but then it limit at 2^53, anyway to solve this? or is it the limit of R? or maybe the program I use?

标签: r

解决方案


You can try as.bigz from gmp package

A <- gmp::as.bigz(2**53)
B <- 1

such that

> A+B-A
Big Integer ('bigz') :
[1] 1

推荐阅读