[R] Bug in "is" ?
Lucke, Joseph F
Joseph.F.Lucke at uth.tmc.edu
Mon Sep 29 16:24:09 CEST 2008
Stefan
You are right. Briefly put, the existence of 7 requires only Peano's
axiom for successive integers. Strictly speaking, 7 is not an integer
but a natural number. But natural numbers can be embedded in the
integers which can be embedded in the rationals which can be embedded
the reals which can be embedded in the complex. Little of this is
relevant to a programming language's two basic storage modes for
numbers. Confusing a variable type with a mathematical set is an
elementary, if entertaining, logical error.
Joe
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Stefan Evert
Sent: Saturday, September 27, 2008 12:27 PM
To: R-help Mailing List
Subject: Re: [R] Bug in "is" ?
Hi everyone!
Sorry for taking an already overlong discussion thread slightly off-
topic, but ...
> quote:
> No doubt, 7.0 is integer in math. But if people can write 7 why people
> need to write 7.0 (I do not see any reason to do this).
> endquote
> What is true in mathematics is not necessarily true in R.
... am I the only one who thinks that the integer 7 is something
entirely different from the real number 7.0? (The latter most likely
being an equivalence class of sequences of rational numbers, but that
depends on your axiomatisation of real numbers.) Integers can be
embedded in the set of real numbers, but that doesn't make them the same
mathematically.
So the original complaint should really have said that is.integer()
doesn't do what a naive user (i.e. someone without a background in
computer science or maths) might expect it to do. :-)
That said, I've fallen into the same trap more than once, and painfully,
myself (often in connection with MySQL).
Best wishes, and with a tiny grain of salt, Stefan Evert
[ stefan.evert at uos.de | http://purl.org/stefan.evert ]
[[alternative HTML version deleted]]
______________________________________________
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