2.87
- 1.88
= 0.99
- 0.99
= -1.0842021724855E-19
I don't do much with a calculator. I'm mostly curious.
I can't complain but I do anyway.
I use ShowCalc, but after replicating what what you have I'm not sure I will
anymore....
That's a *small* round-off error. Have you tried doing the same thing in
another calculator app? I *think* you might see the same result. . .
IOW - I don't think ShowCalc is responsible for the error. . .
The answer is given in scientific notation. The "E-19" at the end
indicates you should move the decimal point 19 spaces to the left to see
the answer in standard notation.
IOW - ShowCalc is telling you that the answer is:
-0.00000000000000000010842021724855
if I counted the zeros correctly. . . ;)
Susam
--
Pricelessware & ACF: http://www.pricelesswarehome.org
ACF FAQ: http://clients.net2000.com.au/~johnf/faq.html
ACF wiki: http://www.markcarter.me.uk/cgi-bin/wiki.pl?AcfWiki
I don't do much with a calculator. I'm mostly curious.
Cousin John Doe ....
'''
The seemingly odd behavior you've observed
with your example numbers is probably not a problem
with the particular calculator program you're using
but one that is common to all computations
that use *floating poing* arithmetic ....
Many fractional values cannot be represented accurately
in binary machines by floating point methods ....
Some floating numbers are first scaled
and then converted to integer representation
before computations are carried out ....
For example, money calculations ....
Following are the internal representations
used for the example in Python ....
Floating Point ........... Internal Representation
a ....... : 2.87 .... 2.8700000000000001
b ....... : 1.88 .... 1.8799999999999999
c ....... : 0.99 .... 0.98999999999999999
d = a - b : 0.99 .... 0.99000000000000021
e = d - c : 0.00 .... 2.2204460492503131e-16
Scaled Integers ....
287
188
99
0
-1
Python code that prodced the output above
follows ....
'''
# floating point numbers
a = 2.87
b = 1.88
c = 0.99
d = a - b
e = d - c
dict_floats = { 'a .......' : a ,
'b .......' : b ,
'c .......' : c ,
'd = a - b' : d ,
'e = d - c' : e }
list_floats = dict_floats.keys()
list_floats.sort()
print
print ' Floating Point ........... Internal Representation .... '
print
for this in list_floats :
data = this , dict_floats[ this ] , repr( dict_floats[ this ] )
print ' %s : %.2f .... %s' % ( data )
# Multiply floats by 100 and convert to integer
ia = int( a * 100 )
ib = int( b * 100 )
ic = int( c * 100 )
# Divide results by 100
id = ( ia - ib ) / 100
ie = ( id - ic ) / 100
data_int = [ ia , ib , ic , id , ie ]
print
print ' Scaled Integers .... '
print
for this_item in data_int :
print ' %s' % this_item
--
Cousin Stanley
Human Being
Phoenix, Arizona
I'll wake up in a week or two ....
>
> [ *floating poing* ] ----> ( *floating point* )
>
> I'll wake up in a week or two ....
A floating poing would be more interesting, though.
For more on floating point arithmetic and the possible errors that
it brings:
http://en.wikipedia.org/wiki/Computer_numbering_formats
http://www.lahey.com/float.htm
Wald
>> 2.87
>> - 1.88
>> = 0.99
>> - 0.99
>> = -1.0842021724855E-19
I really like ShowCalc and have never had any problems with it, but would
like to avoid problems like this. Can anyone recommend anything similar but
better?
I also tried the PC Mag tape calculator, but it is not as good and it's not
freeware anyway.
--
Iain
Please check www.pricelesswarehome.org, the FAQ and Google Groups before
posting in alt.comp.freeware.
>"badgolferman" <REMOVETHISb...@gmail.com> wrote in
>news:350mfaF...@individual.net:
>
>>> 2.87
>>> - 1.88
>>> = 0.99
>>> - 0.99
>>> = -1.0842021724855E-19
>
>I really like ShowCalc and have never had any problems with it, but would
>like to avoid problems like this. Can anyone recommend anything similar but
>better?
>
>I also tried the PC Mag tape calculator, but it is not as good and it's not
>freeware anyway.
I've used SmartSum for several years,,
looking at the screen shot, that appears to be adware, not freeware.
while technically not a "tape" calculator, addup does a good job:
http://orefa.com/addup/1/index.html
> "badgolferman" <REMOVETHISb...@gmail.com> wrote in
> news:350mfaF...@individual.net:
>
>>> 2.87
>>> - 1.88
>>> = 0.99
>>> - 0.99
>>> = -1.0842021724855E-19
>
> I really like ShowCalc and have never had any problems with it, but would
> like to avoid problems like this. Can anyone recommend anything similar but
> better?
>
> I also tried the PC Mag tape calculator, but it is not as good and it's not
> freeware anyway.
Take a look at CalcAnt, have used it for a long time with no problems.
http://www.calcant.net/ site also in German but don't have link
GoodTime Barnie
I'll try this out and the suggestions and let you know. I'm not sure
what is a good all-round accuracy test though, so any suggestions would
be appreciated. In the meantime, I'll use the calculation above.
> badgolferman wrote:
>> John Doe wrote:
>>
>>>Explain this.
>>>
>>> 2.87
>>>- 1.88
>>>= 0.99
>>>- 0.99
>>>= -1.0842021724855E-19
>>>
>>>I don't do much with a calculator. I'm mostly curious.
>>>
>>>I can't complain but I do anyway.
>>
>>
>> I use ShowCalc, but after replicating what what you have I'm not sure
>> I will anymore....
>
> That's a *small* round-off error. Have you tried doing the same thing
> in another calculator app? I *think* you might see the same result. .
> . IOW - I don't think ShowCalc is responsible for the error. . .
>
> The answer is given in scientific notation. The "E-19" at the end
> indicates you should move the decimal point 19 spaces to the left to
> see the answer in standard notation.
>
> IOW - ShowCalc is telling you that the answer is:
>
> -0.00000000000000000010842021724855
>
> if I counted the zeros correctly. . . ;)
>
>
> Susam
This one does not repeat this "error"
http://www.moffsoft.com/freecalc.htm
* Moffsoft FreeCalc (http://www.moffsoft.com/freecalc.htm)
* calcAnt (http://www.calcant.net/calcant.html)
* AddUp (http://orefa.com/)
* ESBCalc (http://www.esbconsult.com/esbcalc/esbcalc.html)
I almost evaluated gtapecalc (http://gtapecalc.sourceforge.net/), but it
requires GTK and complition.
XCALC (http://www.tordivel.no/xcalc/) is another tape calculator, but it
uses RPN (http://en.wikipedia.org/wiki/Reverse_Polish_notation), which is
useless for most people.
*Moffsoft FreeCalc*
Nice simple interface.
Passed the arithmetic test that ShowCalc failed.
Just simple arithmetic operators.
There is a advanced payware version.
*calcAnt*
Passed the arithmetic test that ShowCalc failed.
Just simple arithmetic operators.
Initially installs with German text. You have to find the Options page to
change to English.
Interesting text editor mode, that you can use to save text files.
*AddUp*
Passed the arithmetic test that ShowCalc failed.
Just simple arithmetic operators.
Slightly strange and ugly interface.
Allows you to remove buttons text, if, like me, you use the number pad on
your keyboard for input.
*ESBCalc*
Slightly ugly, but simple interface.
Passed the arithmetic test that ShowCalc failed.
Includes scientific operators.
There is a advanced payware version.
There is a no-install option.
My favourite was ESBCalc. Its accuracy, no-install option, OK interface
and many features mean it will replace ShowCalc.
If anyone else knows of good tape calculators or proper calculator
accuracy tests, please let me know.
>
>"Bill Day" <somethi...@comcast.net> wrote in message
>news:0kpnu09g5bg363h8d...@4ax.com...
>> On 17 Jan 2005 15:52:28 GMT, Iain Cheyne
>> <myfir...@mysecondname.net> wrote:
>>
>>>"badgolferman" <REMOVETHISb...@gmail.com> wrote in
>>>news:350mfaF...@individual.net:
>>>I also tried the PC Mag tape calculator, but it is not as good and it's
>>>not
>>>freeware anyway.
>> I've used SmartSum for several years,,
>>
>> http://www.smartcode.com/smartsum/
>
>looking at the screen shot, that appears to be adware, not freeware.
it's never offered ME an ad...and it still says 'free' in red
letters...I have no idea why that screenshot looks like that...and I
see no place on the web page that offers a way to pay ot remove any
ads.....which, as I say, I have never seen... *shrug*
I settled on MoffSoft FreeCalc. The ESBCalc had too many advanced
function buttons for doing checkbook reconciliation.
> *ESBCalc*
> Slightly ugly, but simple interface.
> Passed the arithmetic test that ShowCalc failed.
> Includes scientific operators.
> There is a advanced payware version.
> There is a no-install option.
>
> My favourite was ESBCalc. Its accuracy, no-install option, OK
> interface and many features mean it will replace ShowCalc.
I just tried SmartSum (http://www.smartcode.com/smartsum/).
There is no adware and it's *very* nice.
Good looking but busy interface.
Passed the arithmetic test that ShowCalc failed.
Includes scientific operators.
It has the most impressive feature set of all: macros, special buttons,
conversions, subtotals, voice speaking after actions.
It can even automatically replace the Windows Calculator, calc.exe.
I still prefer ESBCalc, as it is simpler and does not require an install,
but it is a very close-run thing.
Cousin wald ....
Thanks for the links ....
The Wikipedia article leaves the following
as the bottom line to their discussion on
floating point ....
"The point here is that a computer isn't magic,
it is a machine and is subject to certain rules
and constraints. Although many people place
a childlike faith in the answers computers give,
even under the best of circumstances these machines
have a certain unavoidable inexactness built into
their treatment of real numbers."