[R] double.xmin really the smallest non-zero normalized floating-point number?

2013-09-10 Thread Marius Hofert
Hi,

?.Machine says that 'double.xmin' is 'the smallest non-zero normalized
floating-point number'. On my machine, this is 2.225074e-308. However,
2.225074e-308 / 2 is  0 and smaller than 2.225074e-308, so
double.xmin is not the smallest such number (?) Am I missing anything?

Cheers,

Marius

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] double.xmin really the smallest non-zero normalized floating-point number?

2013-09-10 Thread William Dunlap
'normalized' is key.  A normalized double precision floating point
number has 52 binary digits of precision and .Machine$double.eps/2
does not.  E.g.,

   bitsOfPrecision - function(x)max(which( x != x*(1+2^-(1:60
   bitsOfPrecision(4)
  [1] 52
   bitsOfPrecision(.Machine$double.xmin)
  [1] 52
   bitsOfPrecision(.Machine$double.xmin/2)
  [1] 51
   bitsOfPrecision(.Machine$double.xmin/4)
  [1] 50

Google for 'normalized floating point'.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf
 Of Marius Hofert
 Sent: Tuesday, September 10, 2013 2:50 PM
 To: R-help
 Subject: [R] double.xmin really the smallest non-zero normalized 
 floating-point number?
 
 Hi,
 
 ?.Machine says that 'double.xmin' is 'the smallest non-zero normalized
 floating-point number'. On my machine, this is 2.225074e-308. However,
 2.225074e-308 / 2 is  0 and smaller than 2.225074e-308, so
 double.xmin is not the smallest such number (?) Am I missing anything?
 
 Cheers,
 
 Marius
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.