I tried to multiply 111111111*111111111
, which is the same as 111111111^2
, and got incorrect results. It should give 12345678987654321
, but instead it gives a rounding error. Do I need to use some special variable type for long numbers or is this a bug with R?
相关问题
- R - Quantstart: Testing Strategy on Multiple Equit
- Using predict with svyglm
- Reshape matrix by rows
- Extract P-Values from Dunnett Test into a Table by
- split data frame into two by column value [duplica
相关文章
- How to convert summary output to a data frame?
- How to plot smoother curves in R
- Paste all possible diagonals of an n*n matrix or d
- ess-rdired: I get this error “no ESS process is as
- How to use doMC under Windows or alternative paral
- dyLimit for limited time in Dygraphs
- Saving state of Shiny app to be restored later
- How to insert pictures into each individual bar in
The 'gmp' package will allow you to do operations on values that large though.
Also, new package int64 from Romain Francois.
It's not a limitation of R specifically, it's a limitation of double precision floating-point arithmetic. A standard double-precision floating-point number has around 16 decimal digits of accuracy. The answer to your sum requires 17. R does not have a variable type with greater precision, but neither do many other languages.