[PATCH] Added #odd method

1 view
Skip to first unread message

Canol Gökel

unread,
Jul 15, 2008, 7:08:04 PM7/15/08
to syx-d...@googlegroups.com
This patch adds #odd method for Integer class as defined in the standards, so that you can test if an integer number is odd or not.

This is my first try to create a patch, I hope uploading bigger patches in the future...
0001-Added-odd-method.patch

Luca Bruno

unread,
Jul 16, 2008, 1:23:23 PM7/16/08
to syx-d...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 16 Jul 2008 02:08:04 +0300
"Canol Gökel" <canol...@gmail.com> wrote:

> This patch adds #odd method for Integer class as defined in the standards,
> so that you can test if an integer number is odd or not.
>

What about self \\ 2 == 1?

> This is my first try to create a patch, I hope uploading bigger patches in
> the future...

Thanks very much.

- --
http://syx.googlecode.com - Smalltalk YX
http://lethalman.blogspot.com - Thoughts about computer technologies
http://www.ammazzatecitutti.org - Ammazzateci tutti
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkh+LosACgkQw9Qj+8Kak3HdXgCgkJYkfC3vQjBhZ2cxOxwl5o06
jLgAnjZuEvm5jOYk84uTWPwL4S8F4dVz
=jMDz
-----END PGP SIGNATURE-----

ZuLuuuuuu

unread,
Jul 16, 2008, 7:44:56 AM7/16/08
to Syx general discussion
Although I'm not sure (because I didn't looked at \\ implementation),
I guess for big numbers just controlling the last bit will be faster
than looking at the remainder for a division process.

On Jul 16, 8:23 pm, Luca Bruno <lethalma...@gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wed, 16 Jul 2008 02:08:04 +0300
>
> "Canol Gökel" <canol.go...@gmail.com> wrote:
> > This patch adds #odd method for Integer class as defined in the standards,
> > so that you can test if an integer number is odd or not.
>
> What about self \\ 2 == 1?
>
> > This is my first try to create a patch, I hope uploading bigger patches in
> > the future...
>
> Thanks very much.
>
> - --http://syx.googlecode.com- Smalltalk YXhttp://lethalman.blogspot.com- Thoughts about computer technologieshttp://www.ammazzatecitutti.org- Ammazzateci tutti

Luca Bruno

unread,
Jul 16, 2008, 11:59:52 PM7/16/08
to syx-d...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 16 Jul 2008 04:44:56 -0700 (PDT)
ZuLuuuuuu <canol...@gmail.com> wrote:

>
> Although I'm not sure (because I didn't looked at \\ implementation),
> I guess for big numbers just controlling the last bit will be faster
> than looking at the remainder for a division process.
>

I don't know, however we'll have to check deeply all the standard for the 0.2 milestone
(this is not related to you, also to my code ;) ):

commit 39aaf754c0fdee283f238e0b5fed14fb9ddcf3c4

Feel free to create a patch for #even too and any other methods.
Thanks very much.

- --
http://syx.googlecode.com - Smalltalk YX
http://lethalman.blogspot.com - Thoughts about computer technologies
http://www.ammazzatecitutti.org - Ammazzateci tutti
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkh+w7gACgkQw9Qj+8Kak3HzAQCeN94N2PPi4ouZi4wGY5gSVi0A
7vgAn1BdqbBXs/b4XfwTpijpNc2a0qfF
=YQjF
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages