I would like to change the precision in a calculation of R. For example I would like to calculate x^6
with x = c(-2.5e+59, -5.6e+60)
. In order to calculate it I should change the precision in R, otherwise the result is Inf
, and I don't know how to do it.
相关问题
- 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
As Livius points out in his comment, this is an issue with R (and in fact, most programming language), with how numbers are represented in binary.
To work with extremely large/small floating point numbers, you can use the
Rmpfr
library:To work with numbers that are even larger than R can handle (e.g.
exp(1800)
) you can use the "Brobdingnag" package: