| [reply] |
my $value = get_numeric_value_from_somewhere();
print 'Will always be printed' if ($value/$value) == 1;
# Except for zero!!
the above is true, for 1/1; -1/-1; .1/.1; -.1/-.1; etc. etc. all the way down to the smallest values on either side of zero that any given machine can represent.
Out of interest, after I posted I did a quick google on the net and discovered that at least one computer langauge treats 0/0 as 1. Namely APL, which as its a language essentially designed for mathematical problem solving, at least makes me feel a little better regarding the notion, even if ultimately 0/0=1 isn't correct in the pure math sense.
Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring! | [reply] [d/l] |
my $value= get_numeric_value_from_somewhere();
eval { print 'Will never be printed' if ($value/0) }
# except for zero, you want?!
The result is true for .1/0, .0001/0, etc. etc. all the way down to the smallest values on either side of zero that any given machine can represent.
Why should it be different for zero itself?
| [reply] [d/l] |
Not only that, but "infinity" doesn't name one number. There are different infinities ...
For example, the set of natural numbers (0,1,2,3,...), aka N, is a *denumerable* infinity ('denumerable' meaning, 'can be put in a 1:1 correspondence with the members of N' -- so N satisfies this definition trivially), as is the set of multiples of 10 -- EVEN THOUGH that set is a subset of N. The set of multiples of 10 is, intuitively, a tenth the size of N? But no, for every member of the set of multiples of 10, you can find a partner in N.
Moreover, there are non-denumerable infinities (memory gets fuzzy here): the power set (set of all subsets) of N is non-denumerable; and the set of real numbers is also non-denumerable -- there are too many points on the real line to put in a 1:1 correspondence with N (intuitively: though with the case of multiples of 10, there is a way to figure out what the next number is, there's no way to find the "next point" given a specific point on the real line).
Isn't math fun?
If not P, what? Q maybe? "Sidney Morgenbesser"
| [reply] |
Yes, and it gets weirder than that if you think further along those lines. In sets beyond the natural numbers, among the real numbers f.ex, any two numbers are separated by an infinite set of numbers. In fact, because you can translate any set of reals delimited by two numbers (exclusive) to any other set of reals delimited by any two numbers (exclusive) with a single multiplication, this means that the distance between any two numbers is equally large.
F.ex, the set of numbers between 1.0 and 2.0 exclusive is inifinite. No matter how many members you assume, there are still more numbers between those. The same is true for the set of numbers between 2.0 and 10.0 - it is infinite. But although the interval from 1.0 to 2.0 exclusive is of length 1, and that from 2.0 to 10.0 exclusive is of length 8, you can map the set { x ∈ R ; 1.0 < x < 2.0 } to set { x ∈ R ; 2.0 < x < 10.0 } by simply multiplying by 8.
As I said on the onset of this thread: zero and infinity are deep voodoo. Zero is deceptively so, it looks innocent at first, but it's still voodoo.
Makeshifts last the longest.
| [reply] |