Path: ccrwest.org!not-for-mail From: dmoews@xraysgi.ims.uconn.edu (David Moews) Newsgroups: comp.lang.c,sci.math Subject: Re: Contest: C BIGNUM BAKEOFF; clarification by the proposer Date: 12 Dec 2001 12:13:51 -0800 Organization: University of Connecticut IMS Lines: 46 Message-ID: <9v8dpv$bv4$1@lydian.ccrwest.org> References: <200112120215.VAA19937@xraysgi.ims.uconn.edu> NNTP-Posting-Host: lydian.ccrwest.org X-Trace: lydian.ccrwest.org 1008188031 12261 192.203.205.93 (12 Dec 2001 20:13:51 GMT) X-Complaints-To: usenet@ccrwest.org NNTP-Posting-Date: 12 Dec 2001 20:13:51 GMT Xref: ccrwest.org comp.lang.c:435108 sci.math:420190 1. Entries must be e-mailed, not posted. 2. Everybody can enter as often as they wish. 3. Some people have replied to Mike Oliver as if he proposed the contest. He did not. 4. Entrants are not required to submit any explanatory text, but they are encouraged to as it will make judging the contest easier. 5. This contest is a variation of the Busy Beaver. Attempts to find a biggest, or infinite, integer with for-loops, casts to and from unsigned, shifts, etc. are doomed to fail. This is because there is no biggest, or infinite, integer. In particular, (int)~0U, (int)~0U>>1, (int)(unsigned)-1, (int)(unsigned)~0, and (int)((unsigned)~0>>1) are all equal to -1, and (int)(unsigned)-2 and (int)((unsigned)-3>>1) are equal to -2. Rule 7 was intended to make this clear, as I will explain in my next post. 6. I agree that a conforming implementation of C90, or C99, cannot have infinite-sized ints. However I disagree that the language used in this contest is therefore not C. C existed long before C90. 7. INT_MAX, UINT_MAX, and so forth are part of the standard library. Use of these constants is therefore forbidden by rule 1(h). 8. A program that prints out '9's forever fails in three ways. The big number is to be returned from main(), not printed (rule 3); also, this uses I/O, which is forbidden (rule 1(h)), and never terminates (violating rule 3.) 9. Bruce Wheeler quotes the standard in an attempt to show that in order to avoid implementation-defined behavior, main() must return 0, EXIT_FAILURE, or EXIT_SUCCESS. The object of the contest is to return a big number from main(). The events happening after main() returns, such as calling functions defined by atexit(), closing streams, returning to the operating system, etc. do not matter. -- David Moews dmoews@xraysgi.ims.uconn.edu