Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!uunet!munnari!moncskermit!trldeity!trlamct!sunk!richb From: richb@sunk.UUCP Newsgroups: comp.sources.bugs Subject: Re: binary display problem in calctool. Message-ID: <231@sunk.oz> Date: Wed, 2-Sep-87 02:05:46 EDT Article-I.D.: sunk.231 Posted: Wed Sep 2 02:05:46 1987 Date-Received: Fri, 4-Sep-87 01:46:46 EDT Organization: Sun Microsystems Australia Lines: 46 Keywords: Take 2. A little while ago Paul Czarnecki found a bug in calctool when binary numbers near the capacity of the calculator were being displayed incorrectly. I put out a fix which partly fixed this problem but caused the accuracy feature to work incorrectly. Paul kindly mailed me his correction, and after we decided that the calculator shouldn't try to grovel (the word sorry was removed from the display message), we have a solution that appears to work correctly. This is for version 1.2. Again, I can't give diffs because the version I'm currently working on it two releases later. This is in the routine make_number in calctool.c: if ((ndig = ddig + accuracy) > cmax) { if (ddig > cmax) { STRCPY(display,"Overflow") ; display_result(display) ; error = 1 ; return ; } else { STRCPY(display, "Reducing precision") ; display_result(display) ; sleep(1) ; bzero(display); accuracy = cmax - ddig ; if (accuracy < 0) accuracy = 0; ndig = ddig + accuracy; } } If this is all getting too confusing, then you might wish to just wait for v1.4, which I've just posted to comp.sources.misc. Sorry for the confusion, and thanks again Paul. Rich. Rich Burridge, JANET richb%sunk.oz@uk.ac.ucl.cs ACSnet richb@sunk.oz UUCP {seismo,hplabs,ukc}!munnari!sunk.oz!richb PHONE: +61 3 811 9927 ARPAnet richb%sunk.oz@seismo.css.gov MAIL: Sun Microsystems, 123 Camberwell Rd, Hawthorn, VICTORIA 3122, AUST D D D