About The Contest
The first ever Olympiad of Misguided Geeks contest at Worse Than Failure (or OMGWTF for short) is a new kind of programming contest. Readers are invited to be creative with devising a calculator with the craziest code they can write. One lucky and potentially insane winner will get either a brand new MacBook Pro or comparable Sony VAIO laptop.
Entry #100126: Crash Calculator
by Tyler Krpata
The code is not changed much from the GTK skeleton code. The big difference is that DoOperation() is now a void function. The function performs the appropriate calculation, then attempts to access the memory location at the floating-point representation of the answer, then we handle SIGSEGV to find the answer. There is also a SIGFPE handler to catch divide-by-zero.