WW1138: Updated Calculator Accessory for Windows

Last reviewed: May 1, 1997
Article ID: Q124345
3.10 3.11 WINDOWS kbappnote kbfile kbtlc kbbuglist

The information in this article applies to:

  • Microsoft Windows operating system versions 3.1, 3.11
  • Microsoft Windows for Workgroups, versions 3.1, 3.11

This Application Note provides an updated version of the Calculator accessory that is shipped with Microsoft Windows 3.1x and Windows for Workgroups 3.1x. Previous versions of Calculator display simple subtraction errors when you subtract two numbers that include values to the right of the decimal point.

You can obtain this Application Note from the following sources:

  • Microsoft's World Wide Web Site on the Internet
  • The Internet (Microsoft anonymous ftp server)
  • Microsoft Download Service (MSDL)
  • Microsoft FastTips Technical Library
  • Microsoft Product Support Services

For complete information, see the "To Obtain This Application Note" section at the end of this article.

THE TEXT OF WW1138

  Microsoft(R) Product Support Services Application Note (Text File)
          WW1138: UPDATED CALCULATOR ACCESSORY FOR WINDOWS(R)
                                                   Revision Date: 1/95
                                                       1 Disk Included

The following information applies to Microsoft Windows and Windows for Workgroups, versions 3.10 and 3.11.

 ---------------------------------------------------------------------
| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |
| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |
| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |
| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |
| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |
| PURPOSE. The user assumes the entire risk as to the accuracy and    |
| the use of this Application Note. This Application Note may be      |
| copied and distributed subject to the following conditions:  1) All |
| text must be copied without modification and all pages must be      |
| included;  2) If software is included, all files on the disk(s)     |
| must be copied without modification (the MS-DOS(R)  utility         |
| diskcopy is appropriate for this purpose);  3) All components of    |
| this Application Note must be distributed together;  and  4) This   |
| Application Note may not be distributed for profit.                 |
|                                                                     |
|                                                                     |
| Copyright (C) 1995 Microsoft Corporation.  All Rights Reserved.     |
| Microsoft, MS-DOS, and Windows are registered trademarks of         |
| Microsoft Corporation. Intel and Pentium are registered trademarks  |
| of Intel Corporation.                                               |
 --------------------------------------------------------------------

Introduction

The WW1138 disk included with this Application Note contains an updated version of the Calculator accessory that is shipped with Microsoft Windows 3.1x and Windows for Workgroups 3.1x. Previous versions of Calculator display simple subtraction errors when you subtract two numbers that include values to the right of the decimal point. While Calculator is determining how to display the solution, it encounters a loss of precision and shows an incorrect answer.

   NOTE: This rounding error is unrelated to the floating-point unit
   (FPU) in the Intel(R) Pentium(R) chip. This problem occurs only in
   Calculator and does not affect Windows, other components in Windows,
   or other Windows-based applications.

In addition to correcting the problem described above, the new rounding algorithm in Calculator causes it to perform more like most hand-held calculators. For example, if you enter the following equation in the updated Calculator accessory or in a hand-held calculator

   [(1/3 + 10 - 10) x 3]

the result is 0.9999. The result in previous versions of Calculator is 1.0. The value 0.9999 is generated because significant digits are lost by adding and subtracting 10. This is a secondary effect of the changes made in Calculator to correct the precision errors.

To install the updated files

  1. Quit Windows, or open an MS-DOS command prompt within Windows.

  2. Rename the existing CALC.EXE file in your Windows directory. For example, if Windows is installed in a directory on drive C called WINDOWS, type the following commands, pressing ENTER after each line:

          cd\windows
          ren calc.exe calc.old
    

  3. If you received a disk with this Application Note, insert the disk in the appropriate floppy disk drive.

    If you downloaded this Application Note from an online service, skip to step 4. This procedure assumes that you have already downloaded and extracted the compressed file.

  4. At an MS-DOS command prompt, type the following and press ENTER

          copy <source>:\calc.exe <location>
    

    where <source> is either the letter of your floppy disk drive or the directory containing the file you downloaded from online services, and <location> is the path to your Windows directory. For example, if you are installing from a floppy disk that you inserted in drive A, and C:\WINDOWS is the path to your Windows directory, type:

          copy a:\calc.exe c:\windows
    

    Or, for example, if you downloaded the WW1138.EXE file from online services to C:\DOWNLOAD and C:WINDOWS is the path to your Windows directory, type:

          copy c:\download\calc.exe c:\windows
    

    You are now ready to restart Windows (if necessary) and run the updated Calculator accessory.

Steps to Reproduce Problem Using Previous Versions of Calculator

  1. To perform this test, choose two numbers that include values to the right of the decimal point (for example, 12.52 and 12.51).

  2. Double-click the Calculator icon in the Accessories group.

  3. Enter the larger number first (for example, 12.52).

  4. Press the MINUS SIGN (-).

  5. Enter the smaller number (for example, 12.51).

  6. Press the EQUAL SIGN (=).

Note that in this example you do not receive .01, the expected result. Instead, you receive one of the following:

   0.00
   0.0099999999
   0.010000001

The updated Calculator accessory displays the correct result, which is .01.

TO OBTAIN THIS APPLICATION NOTE

You can find WW1138.EXE (size: 41480 bytes) 
                       , a self-extracting file, on the following
services:
  • Microsoft's World Wide Web Site on the Internet

          On the www.microsoft.com home page, click the Support icon.
          Click Knowledge Base, and select the product.
    
          Enter kbfile WW1138.EXE (size: 41480 bytes) 
                                 , and click GO!
          Open the article, and click the button to download the file.
    
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the Softlib/Mslfiles folder.
          Get WW1138.EXE (size: 41480 bytes) 
    
  • Microsoft Download Service (MSDL)

          Dial (425) 936-6735 to connect to MSDL
          Download WW1138.EXE (size: 41480 bytes) 
    

For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online
               Services

  • If you are unable to access the source(s) listed above, you can have this Application Note mailed to you by calling Microsoft Product Support Services Monday through Friday, 6:00 A.M. to 6:00 P.M. Pacific time at (425) 637-7098. If you are outside the United States, contact the Microsoft subsidiary for your area.


  • KBCategory: kbappnote kbfile kbtlc kbbuglist
    KBSubcategory: win31 wfw wfwg
    Additional reference words: 3.10 3.11 ww31tlc wg31tlc wg311tlc
    Keywords : wfw wfwg win31 kbappnote kbbuglist kbfile kbtlc
    Version : 3.10 3.11
    Platform : WINDOWS


    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: May 1, 1997
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.