Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
364 views
in Technique[技术] by (71.8m points)

r - How can I get the min/max possible numeric?

Is there a function that returns the highest and lowest possible numeric values?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

help(numeric) sends you to help(double) which has

Double-precision values:

 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.

So you want to look at .Machine which on my 64-bit box has

$double.xmin
[1] 2.22507e-308

$double.xmax
[1] 1.79769e+308

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...