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

Entry #100071 - Strainu's Calculator

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 #100071 - Strainu's Calculator

    Basicly, my program does all the operations as defined by the IEEE 754 standard. It extracts the sign, exponent and mantissa from the parameters, then makes the operation. You can find the exact steps I followed at http://meseec.ce.rit.edu/eecc250-winter99/250-1-27-2000.pdf . Unfortunately, it contains some ugly code, namely the way i get the bits from the float, using an union. The code is also quite buggy, as it totaly ignores the standard's requirements for rounding and gradual precision loss. The code will not work on a machine that does not represents floats as IEEE754 (obviously). Also, it will probably wown't work on another compiler, because i used a proprietary type, namely __int64.
Page 1 of 1 (1 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems