6

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?

Rohit Pandey
  • 2,443
  • 7
  • 31
  • 54

2 Answers2

12

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

Dmitry Bychenko
  • 180,369
  • 20
  • 160
  • 215
6

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.

Carl Witthoft
  • 20,573
  • 9
  • 43
  • 73