[Rd] sqrt(.Machine$double.xmax)^2 == Inf, but only on Windows in R
Ivan Krylov
|kry|ov @end|ng |rom d|@root@org
Tue Apr 29 12:32:50 CEST 2025
On Tue, 29 Apr 2025 12:00:09 +0200
Martin Maechler <maechler using stat.math.ethz.ch> wrote:
> Would you (or anybody else) know if this is new behaviour or it
> also happened e.g. in R 4.4.x versions on Windows?
R-4.3.1 on Windows 7 in a virtual machine gives:
dput(sqrt(.Machine$double.xmax), control = 'hex')
# 0x1p+512
sqrt(.Machine$double.xmax)^2
# [1] Inf
...which differs from R on Linux:
dput(.Machine$double.xmax, control = 'hex')
# 0x1.fffffffffffffp+1023
dput(sqrt(.Machine$double.xmax), control = 'hex')
# 0x1.fffffffffffffp+511
dput(sqrt(.Machine$double.xmax)^2, control = 'hex')
# 0x1.ffffffffffffep+1023
--
Best regards,
Ivan
More information about the R-devel
mailing list