Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!panda!teddy!jpn From: jpn@teddy.UUCP (John P. Nelson) Newsgroups: comp.sys.ibm.pc Subject: Re: Turbo C division bug Message-ID: <4130@teddy.UUCP> Date: Mon, 22-Jun-87 18:29:10 EDT Article-I.D.: teddy.4130 Posted: Mon Jun 22 18:29:10 1987 Date-Received: Tue, 23-Jun-87 05:42:51 EDT References: <105@flnexus.ATT.COM> Reply-To: jpn@teddy.UUCP (John P. Nelson) Organization: GenRad, Inc., Concord, Mass. Lines: 115 >It [Turbo C] does, however, seem to have a serious bug with the floating >point division routines. If your program does division on two constants: > >float x; > >x = 5.0/4.0; > >The result will be as if the division was inverted (i.e x = 4.0/5.0) And here is the patch. Apparently only the earliest copies are afflicted with the bug. Enjoy. PRODUCT : TURBO C VERSION : 1.0 OS : PC-DOS DATE : MAY 20, 1987 PAGE : 1/2 TITLE : FLOATING POINT EVALUATION - PATCH The following patch solves a problem with dividing floating point evaluation. To apply this patch, you will need to use the DOS utility DEBUG.COM. You may obtain a copy of DEBUG.COM from one of your original PC-DOS or MS-DOS diskettes. NOTE: 1. Do not patch your original Turbo C disk, use a working or backup copy of TCC.EXE and TC.EXE for this patch. 2. DEBUG is not sensitive to upper and lower case. All ad- dresses are listed in upper case for ease of readibility. 3. XXXX,YYYY,ZZZZ are hexidecimal digits returned by DEBUG. You must replace these digits accordingly when typing in your commands. 4. While in DEBUG, the prompt will appear as a dash (-). 5. If you do not receive the appropriate response,press "q" followed by , to exit from DEBUG. Check your version number and, if correct, try again. 6. TCC.EXE and TC.EXE will not fit together onto a 360K disk. To patch both programs on a floppy disk, you may need to copy TCC.EXE and DEBUG.COM onto one disk and perform the patch. Save the patched version of TCC.EXE to another disk. Repeat the same steps using TC.EXE. At the DOS prompt, type the following information exactly as it appears (Conclude each line by pressing ). PRODUCT : TURBO C VERSION : 1.0 OS : PC-DOS DATE : MAY 20, 1987 PAGE : 2/2 TITLE : DIVISION OF CONSTANTS - PATCH Patch for TCC.EXE Type the following: You will see: ren tcc.exe tcc.xex A> debug tcc.xex - r ... CS=XXXX ... - h XXXX 2420 YYYY ZZZZ - e YYYY:369 YYYY:0369 0A. 6 - e YYYY:36F YYYY:036F 06. A - w Writing 2948A bytes q A> ren tcc.xex tcc.exe Patch for TC.EXE Type the following: You will see: ren tc.exe tc.xex A> debug tc.xex - r ... CS=XXXX ... - h XXXX 2D01 YYYY ZZZZ - e YYYY:35E YYYY:035E 0A. 6 - e YYYY:364 YYYY:0364 06. A - w Writing 38759 bytes q A> ren tc.xex tc.exe