From p.dalgaard at biostat.ku.dk  Thu Mar 30 13:38:38 2006
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 30 Mar 2006 13:38:38 +0200
Subject: [Rd] function min does not return correct result if
	.Machine$integer.max is involved (PR#8731)
In-Reply-To: <20060330103417.A3A2E19066@slim.kubism.ku.dk>
References: <20060330103417.A3A2E19066@slim.kubism.ku.dk>
Message-ID: <x2odzow4ap.fsf@viggo.kubism.ku.dk>

schlather at hsu-hh.de writes:

> Full_Name: Martin Schlather
> Version: 2.2.0 and alpha 2.3.0 (06/3/29)
> OS: Linux (x86_64 and Intel)
> Submission from: (NULL) (139.11.183.106)
> 
> 
> > min(.Machine$integer.max, 10^20)
> [1] 1e+20
> 
> > min(as.integer(.Machine$integer.max), 10^20)
> [1] 1e+20
> 
> 
> but
> > min(.Machine$integer.max + 0, 10^20)
> [1] 2147483647
> 
> > min(as.integer(.Machine$integer.max - 1), 10^20)
> [1] 2147483646
> 
> > min(as.double(.Machine$integer.max), 10^20)
> [1] 2147483647

I have a vague recollection that we might have used
.Machine$integer.max to represent "integer infinity" at some point. If
so, then the results make some sense, but we don't seem to have
similar conventions in any other places that I can think of (i.e.
as.integer(Inf) is NA, etc.)

-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



[Rd] function min does not return correct result if .Machine$integer.max is involved (PR#8731)
Peter Dalgaard