From hb at stat.berkeley.edu  Thu Apr  1 12:03:22 2010
From: hb at stat.berkeley.edu (Henrik Bengtsson)
Date: Thu, 1 Apr 2010 12:03:22 +0200
Subject: [Rd] Is it valid to do x == Inf?
Message-ID: <j2n59d7961d1004010303ja372b671r8da5fc73ca62edb7@mail.gmail.com>

Hi,

I found in a bit of code the following test for infinity:

  if (x == Inf) ...

Is that valid, or should it be (as I always thought):

  if (is.infinite(x)) ...?

Does it depend on whether 'x' is float or integer?

My question is related to testing for missing values where is.na(x) is required.

/Henrik



[Rd] Is it valid to do x == Inf?
Henrik Bengtsson