[#3006] mismatched quotation — "stevan apter" <apter@...>

ruby documentation uses a punctuation convention i've never seen

13 messages 2000/05/27

[ruby-talk:02888] Re: Just one more wafer thin mint....

From: gotoken@... (GOTO Kentaro)
Date: 2000-05-18 14:12:06 UTC
List: ruby-talk #2888
Hi, 

In message "[ruby-talk:02876] Re: Just one more wafer thin mint...."
    on 00/05/18, David Suarez de Lis <excalibor@demasiado.com> writes:
>Actually, from my Calculus, I recall that 0 is not even considered a natural number...
>
>N = {1, 2, 3, 4, ...}              # these are the natural numbers
>Z = {0, 1, -1, 2, -2, 3, -3, ...}  # and these are the (real :) integers
>
>(actually Z = N U -N U {0})
>
>and the definition of even number is 2N = { n E N / n%2 = 0 } which only applies to natural positive numbers...

For convenience, we often consider zero is an even number in
mathematics (e.g., in term of the symmetric group, an identical
permutation can be regarded as zero times transposition and it is
*even* permutation).

However, the concept of even/odd never be defined for a negative
integer. So, Integer#odd? is not suitable.

>Regarding adding the method, for the sake of small interfaces, I'd say (n%2 == 1) is short enough and obvious enough to a programmer to be just enough (aliteration and repetition by accident :)

Me too :-)

-- gotoken

In This Thread

Prev Next