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 #100138: Ultra-Portable WTFCalc

by Dark Shikari
The purpose of this code is to provide a calculator function set for what I call "integer floating point". That is,
to avoid the uncertainty and inaccuracy of floating point operations, it uses integer operations on the various
parts of the floating point number to ensure high accuracy. There are some limits to this: some platforms don't have integer arithmetic functions available. Other platforms have very slow bit shifts, like the Pentium 4. To resolve this, I have made it so that the program only uses five operations:

a) = assignments
b) == comparison
c) Bitwise NOT
d) Bitwise

Download0 Comments