View Single Post
Old November 6th, 2005, 09:02 PM  
Awesome Poster
ThePhantom's Forum Picture
Join Date: October 30, 2005
Location: Atlanta, GA
Age: 25

There is a joke amongst computer programmers that Deep Thought may have had some order of operations issues. The following code in the C programming language defines the macros SIX as "1 + 5" and NINE as "8 + 1", and then performs the computation "SIX * NINE". It returns the answer "42", because "SIX * NINE" is expanded by the computer to "1 + 5 * 8 + 1", and the multiplication takes precedence over the additions. This occurs because the macro expansion is textual, not logical — experienced C programmers always surround the content of every macro and each instance of a macro argument with parentheses to avoid problems such as this one.
Gay. Vegetarian. Atheist.
Private message me for cognitive therapy.
I am going to major in social psychology.
*Like What i have to say? Click the scale to the left!*
ThePhantom is offline   Reply With Quote