From tlumley at u.washington.edu  Thu Apr  7 23:13:47 2005
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Thu Apr  7 23:13:58 2005
Subject: [Rd] a couple of things about ":"
In-Reply-To: <39B6DDB9048D0F4DAD42CB26AAFF0AFA076D72@usctmx1106.merck.com>
References: <39B6DDB9048D0F4DAD42CB26AAFF0AFA076D72@usctmx1106.merck.com>
Message-ID: <Pine.A41.4.61b.0504071410040.346778@homer12.u.washington.edu>

On Thu, 7 Apr 2005, Liaw, Andy wrote:

> - It seems counter-intuitive to allow non-integer values as operand for ":".
> It also seems a bit odd that 1:2 returns something with storage.mode
> integer, whereas 0.5:2 gives doubles.  Would it make sense to disallow
> non-integer operands to ":"?  I can't think of a situation when non-integer
> operands for ":" would be good...
>

It depends on what you mean by non-integer.  You certainly want to allow 
operand with storage.mode "double".  You might want to exclude 
non-integers, but then you have problems with rounding:

   a<-sqrt(2)
   b<-sqrt(3)
   (a^2):(b^2)

would fail.  Allowing non-integers up to some tolerance would be needed, 
but then there isn't much reason to forbid 0.5:2, and someone might have a 
use for it.


 	-thomas


[Rd] a couple of things about ":"
Thomas Lumley