|
|
Yeah, But the PR Fallout ...
Since the number holds more digits of precision during calculations, it turns out that 0.07+0.07 is indeed 0.14, not 0.140000...02. Even if you use the memories, so as to actually be using the 0.0700000...01 values.
Indeed, if you program in floating point very often, you'll find that having those little errors like this are actually normal and *extremely* common. However when operations are done with them, things always work out. I don't know all the details of the whys and hows, but it has to do with the IEEE way in which floating point numbers are represented. Certain exact values are impossible to exactly represent (or something like that). I know that often times the results of calculations give things like 14.9999999999999 or 15.0000000000001. But I'm unsure of any of the details as to why. I'm just vague on this. (Anyone with exacting knowledge care to follow up on this for me?) Anyway, it is a tad embarrassing that they didn't write complete algorithms to display it as 0.07 instead of 0.0700000...01, but what users don't know (and can't tell), is that that extra algorithms are written to handle displaying the number the way we want to see it. Internally, the floating point variable is still holding the same value. -Jeff (I've written a few calculators in my time. :) ) |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.13 seconds |
|