Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Largest possible values in R [duplicate]

Tags:

r

max

I was playing around in R and noted that the largest value it can spit out is - 2^1023+2^1022.9999999999999 = 1.797693e+308

This was the same for both the 32 bit version running on a 32 bit machine and a 64 bit version running on a 64 bit machine. What is the reason for this being the maximum number (or some thing close to this) and why is it independent of the architecture of the machine?

like image 998
Rohit Pandey Avatar asked Aug 29 '13 10:08

Rohit Pandey


People also ask

What is the highest possible value of R?

Possible values of the correlation coefficient range from -1 to +1, with -1 indicating a perfectly linear negative, i.e., inverse, correlation (sloping downward) and +1 indicating a perfectly linear positive correlation (sloping upward).

How do I find the largest data in R?

We can find the maximum value index in a dataframe using the which. max() function.

How do I find the largest number in a list in R?

max() function in R Language is used to find the maximum element present in an object.

How do you get the max of each column in R?

For example, if we have a matrix M that contains 2 rows and 2 columns with values 1, 2 in the first row and 3, 4 in the second row then the maximum for each of the columns in that matrix can be found by using the syntax; apply(M,2,max), hence the result will be 3, 4.


2 Answers

It's the maximum possible floating point Double number (see IEEE 754 standard):

http://en.wikipedia.org/wiki/Double-precision_floating-point_format

Floating point values - Single, Double - are computed on FPU and so don't depend on if the computer, OS etc is 32 or 64-bit one

consult ?.Machine and see .Machine$double.xmax

like image 181
Dmitry Bychenko Avatar answered Oct 26 '22 18:10

Dmitry Bychenko


It is not the largest possible value -- just the largest possible float. Check out the packages gmp and Rmpfr for ways to implement arbitrary size and precision numbers.

like image 31
Carl Witthoft Avatar answered Oct 26 '22 18:10

Carl Witthoft