stever@Octopus.COM (Steve Resnick ) (11/13/90)
Hello Netlanders! I have a question for you all (geez, does this guy ever stop asking questions?) :) I have a program where I deal with data using 2 decimal places. I am trying to avoid using IEEE floating point (due to lack of precision [when 1 != 1 it gets hairy]) The numbers I need to deal with are in the range of -99999.99 - +99999.99. What I have come up with is a format which, essentially, takes these numbers from a float, multiplies by 1000 and stores them in a 31bit long. (MSB is used for the sign). This gives me a precision of one place beyond my requirement of two, and leaves me with a "hard" number. No quessing or approximations. What I want to know is, are there any pitfalls to this meathod? Has anyone else implemented anything similar? Any opinions are welcome [asbestos suit intact! :)] Please respond via E-mail to apple!camphq!105!steve.resnick as I don't normally read this group (comp.lang.c), due to the sheer volume. Thanx, in advance, Steve -- ---------------------------------------------------------------------------- steve.resnick@f105.n143.z1.FIDONET.ORG - or - apple!camphq!105!steve.resnick Flames, grammar errors, spelling errrors >/dev/nul The Asylum OS/2 BBS - (408)263-8017 IFNA 1:143/105.0