|
| | |||||||
| Apple Macintosh Hardware Discuss the Apple Macintosh Hardware |
| | LinkBack | Thread Tools |
| |||
| Re: calculator error? Peter McCallum wrote: > When I use Calculator (v3.2.1) to do the following calculation: > 9000 - 8387.7 - 557.3 > > I get the result: > 54.999999999999 > Using v. 4.0 I get the same result. But changing the precision from 12 to 16 gives a more pleasing result. And so does changing the precision to 6. A bit odd. |
| |||
| Re: calculator error? In article <1gx8fdy.xkc4ho1cgzvfwN%p5m8.REMOVETHIS******.com. au>, p5m8.REMOVETHIS******.com.au (Peter McCallum) wrote: > When I use Calculator (v3.2.1) to do the following calculation: > 9000 - 8387.7 - 557.3 > > I get the result: > 54.999999999999 > > What gives? Most computers nowadays converts all floating point numbers into binary form, and then performs operations on those. Thus, round-off errors might occur. You can get better precision in Terminal, by searching for calculator programs: man -k calculator One such program is "bc". You can learn about it by typing "man bc". Then type: echo "9000 - 8387.7 - 557.3" | bc 55.0 Here, the answer is merely a round-off of a higher precision result. -- Hans Aberg |
| |||
| Re: calculator error? Phil Wheeler wrote: > Peter McCallum wrote: > >> When I use Calculator (v3.2.1) to do the following calculation: >> 9000 - 8387.7 - 557.3 >> >> I get the result: >> 54.999999999999 >> > > Using v. 4.0 I get the same result. But changing the precision from 12 > to 16 gives a more pleasing result. And so does changing the precision > to 6. A bit odd. I noticed that about a year ago when I first purchased OSX. (Reminded me of using Fortan in College.) Anyway, changing the precision to 10 worked for me. Thanks for the tip! GW |
| |||
| Re: calculator error? In article <1gx8fdy.xkc4ho1cgzvfwN%p5m8.REMOVETHIS******.com. au>, p5m8.REMOVETHIS******.com.au says... > When I use Calculator (v3.2.1) to do the following calculation: > 9000 - 8387.7 - 557.3 > > I get the result: > 54.999999999999 > > What gives? http://docs.sun.com/source/806-3568/ncg_goldberg.html -- Randy Howard (2reply remove FOOBAR) "I don't really care about being right you know, I just care about success." --Steve Jobs |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calculator | Edward | Windows XP | 6 | 01-26-2008 02:50 AM |
| Calculator | Confused Office User | Windows XP | 2 | 10-02-2007 01:40 AM |
| Calculator | plwm2 | Windows Vista | 5 | 08-10-2007 03:50 PM |
| Calculator | Dave Horne | Windows Vista | 2 | 04-19-2007 11:30 AM |
| calculator error? | Peter McCallum | Apple Macintosh Hardware | 4 | 02-06-2007 06:08 PM |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |