RE: Floating point math is the devil!

avatar

You are viewing a single comment's thread:

One can do fractional math by recording the numerator and denominator separately. The problem is that the set of rational numbers is not closed over some math operations; So you have to avoid those operations. So, you really don't gain that much for all of the extra storage.

One can do fixed decimal math by remembering the location of the decimal place. I've worked on many systems that record every thing as pennies.

Of course there is a problem with every mathematical system we used because it is impossible to create a math system that is complete.



0
0
0.000
1 comments
avatar

Yes, with a programmable computer, you can get it to do any kind of math... the hard way.

But think of things like Autocad. Having a 1/16 fractional system or a 1/12 fractional system would have made a lot of the math and number storage easy.

Instead you have 0.0625 and 0.41667 stored everywhere.

And, as you said, it can be imitated. And moving the decimal place to pennies, or ⅒ of pennies works well for those kinds of integers that deal with money.

0
0
0.000