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

William Dunlap wdunlap at tibco.com
Wed Sep 11 00:07:23 CEST 2013


'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-bounces at r-project.org [mailto:r-help-bounces at 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 at 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.



More information about the R-help mailing list