如何获得最小/最大可能的数字?

时间:2011-09-21 18:03:13

标签: r

是否有一个函数可以返回最高和最低的数值?

2 个答案:

答案 0 :(得分:19)

help(numeric)会将您转到help(double)

  

双精度值:

 All R platforms are required to work with values conforming tothe
 IEC 60559 (also known as IEEE 754) standard.  This basically works
 with a precision of 53 bits, and represents to that precision a
 range of absolute values from about 2e-308 to 2e+308.  It also has
 special values ‘NaN’ (many of them), plus and minus infinity and
 plus and minus zero (although R acts as if these are the same).
 There are also _denormal(ized)_ (or _subnormal_) numbers with
 absolute values above or below the range given above but
 represented to less precision.

 See ‘.Machine’ for precise information on these limits.  Note that
 ultimately how double precision numbers are handled is down to the
 CPU/FPU and compiler.

所以你想看看我的64位盒子上的.Machine

$double.xmin
[1] 2.22507e-308

$double.xmax
[1] 1.79769e+308

答案 1 :(得分:0)

help("numeric")

会要求您这样做

help("double)

这将给出答案:绝对值范围从2e-308到2e + 308。