The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Entry #100054 - Calc.WTF

Last post 06-11-2007 12:09 PM by Alex Papadimoulis. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 06-11-2007 12:09 PM

    Entry #100054 - Calc.WTF

    This calculator should have never left Visual Studio. The main functionality takes place in CalcMaestro.(cpp/h), which is a template based class which will operate with any integer or floating-point type as a template parameter (constrained by type size limits). By default, I have it set to working at `long double`. The main operations of CalcMaestro simply increment or decrement the main value however much is needed to attain the desired value. At some points in the code, it will verify periodically its calculations by taking the current value, dicing it up recreating the related strings, just in case there was an error. If something did in fact go wrong, however, nothing really happens. For the operators + and -, we use increments instead of using these operators. For operators / and *, we use some fun things in math.h, because who knows if / and * are reliable?
Page 1 of 1 (1 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems