PC Review


Reply
Thread Tools Rate Thread

Anybody like ShowCalc?

 
 
John Doe
Guest
Posts: n/a
 
      16th Jan 2005
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.
 
Reply With Quote
 
 
 
 
badgolferman
Guest
Posts: n/a
 
      17th Jan 2005
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....


 
Reply With Quote
 
Susan Bugher
Guest
Posts: n/a
 
      17th Jan 2005
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
--
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



 
Reply With Quote
 
Mel
Guest
Posts: n/a
 
      17th Jan 2005
>On Sun, 16 Jan 2005 20:38:12 GMT, John Doe <(E-Mail Removed)> 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.
>

It looks wrong to me, but hey what do I know... Why don't you ask the
folks at ShowCalc?
 
Reply With Quote
 
Cousin Stanley
Guest
Posts: n/a
 
      17th Jan 2005
| 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.

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 )

print

# 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

print


--
Cousin Stanley
Human Being
Phoenix, Arizona
 
Reply With Quote
 
Cousin Stanley
Guest
Posts: n/a
 
      17th Jan 2005

[ *floating poing* ] ----> ( *floating point* )

I'll wake up in a week or two ....


--
Cousin Stanley
Human Being
Phoenix, Arizona
 
Reply With Quote
 
ozzy
Guest
Posts: n/a
 
      17th Jan 2005
On Sun, 16 Jan 2005 22:24:44 -0500, Susan Bugher <(E-Mail Removed)> wrote:

>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. . .


That's NOT a *small* rounding error... that's an ERROR. PERIOD.

Even Microsofts' Calc.exe doesn't produce this error. I've tested that on every
scientific & normal calculator I have in the house & they don't give an error.

I tested it on an old Z-80 computer.... no error.
C, C++, Fortran, Cobol, Pascal & assembly routines I used didn't produce that
error so it MUST be that ShowCalc is wrong & is poorly coded.

Nothing I tested that math problem with produced errors, even when 64-bit
precision was selected )

I'd dump ShowCalc.... you never know what other errors would be introduced in
future calcs.... I couldn't trust it.

ozzy
 
Reply With Quote
 
wald
Guest
Posts: n/a
 
      17th Jan 2005
Cousin Stanley <(E-Mail Removed)> wrote:

>
> [ *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
 
Reply With Quote
 
Bill Day
Guest
Posts: n/a
 
      17th Jan 2005
On 17 Jan 2005 15:52:28 GMT, Iain Cheyne
<(E-Mail Removed)> wrote:

>"badgolferman" <(E-Mail Removed)> wrote in
>news:(E-Mail Removed):
>
>>> 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,,

http://www.smartcode.com/smartsum/
 
Reply With Quote
 
GoodTime Barnie
Guest
Posts: n/a
 
      17th Jan 2005
On 17 Jan 2005 15:52:28 GMT, Iain Cheyne wrote:

> "badgolferman" <(E-Mail Removed)> wrote in
> news:(E-Mail Removed):
>
>>> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:39 PM.