News for hackers. Stuff that matters.
Re:Who Can Name the Bigger Number? by robinhouston on Thursday July 22, 2010 @06:39PM (#1539764)
“Who can name the bigger number? Whoever has the deeper paradigm.”

In 2001, David Moews ran a BIGNUM BAKEOFF competition on the comp.lang.c newsgroup, where each entry had to be a C program (512 non-whitespace characters or fewer) returning a number from main(). The winner is the program that returns the largest number, assuming an arbitrarily-large int type.

http://groups.google.com/group/comp.lang.c/browse_thread/thr...

After reading Scott Aaronson's wonderful essay, you won't be surprised to hear that the contest was won by a theoretical computer scientist, Ralph Loader. (Second place was taken by Heiner Marxen, who is mentioned in Scott's article in connection with the Busy Beaver problem.)

Ralph Loader's remarkable program is at http://homepages.ihug.co.nz/~suckfish/busy/reduced.c, and the documented and unmangled version in http://homepages.ihug.co.nz/~suckfish/busy/busy.tar.gz

David Moews' discussion of the entries is at http://djm.cc/bignum-results.txt

Re:Who Can Name the Bigger Number? by kd0amg on Friday July 23, 2010 @12:35PM (#1541652)
(I haven't read over the entries yet)

A coworker suggests a Whitespace[1] interpreter which applies the recursion theorem and then interprets a Whitespace program embedded in the source code, characters which do not count towards the size limit. We're not sure yet whether that can be done in 512 characters.

[1] http://en.wikipedia.org/wiki/Whitespace_(programming_languag...

Edit: "Wait... can you make a Quine without using a string literal?"

Re:Who Can Name the Bigger Number? by shasta on Friday July 23, 2010 @09:00PM (#1542817)
Why whitespace? Just pick the simplest to interpret Turing complete language with a two symbol alphabet.

Also: you're disqualified :)

Re:Who Can Name the Bigger Number? by tel on Thursday July 22, 2010 @10:35PM (#1540185)
I find it hilarious that three people thought to return the highest possible number by underflowing unsigned ints (that are being treated as arbitrarily large ints). It's a funny hack even if it doesn't teach you anything like Loader's does.
Re:Who Can Name the Bigger Number? by mseebach on Friday July 23, 2010 @06:44AM (#1540848)
I don't see how that is relevant when the problem assumes an arbitrarily large int-type. It's trivial to return the largest possible value (INT_MAX) for any fixed-size int-type, but a such does not exist.

Basically, many posters are missing the point that it's a mathematics challenge, not a C-challenge, which is excusable since it's posted in a C-group.

Re:Who Can Name the Bigger Number? by tel on Sunday July 25, 2010 @01:50PM (#1545954)
Exactly, which I find hilarious.
Re:Who Can Name the Bigger Number? by amalcon on Thursday July 22, 2010 @11:19PM (#1540235)
My first thought was along those lines: (int)((unsigned int)-1 >> 1)==INT_MAX