Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the min/max possible numeric?

Tags:

r

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

like image 934
SFun28 Avatar asked Sep 21 '11 18:09

SFun28


People also ask

How do you find minimum and maximum values?

Solve for x.Use basic rules of algebra to rearrange the function and solve the value for x, when the derivative equals zero. This solution will tell you the x-coordinate of the vertex of the function, which is where the maximum or minimum will occur.

How can you determine the maximum value that a numeric variable can hold?

To find the max value for the unsigned integer data type, we take 2 to the power of 16 and substract by 1, which would is 65,535 . We get the number 16 from taking the number of bytes that assigned to the unsigned short int data type (2) and multiple it by the number of bits assigned to each byte (8) and get 16.


1 Answers

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
like image 170
Dirk Eddelbuettel Avatar answered Oct 13 '22 01:10

Dirk Eddelbuettel