Commit graph

5 commits

Author SHA1 Message Date
Doug Torrance ec62fab633 wmcalc: Null-termitate display string when clearing.
Often, the number currently being displayed has more than 10 digits.
However, when clearing the display, only the first 10 digits were cleared.
When a new number was entered, it would be prepended to any digits that
weren't cleared.  This behavior was invisible to the user, causing
incorrect calculations, e.g., Debian bug #564173:

1814 / 720 * 300 -> 7568.41111

But the correct answer is 755.833333.

The problem was that when the display was cleared, the string that stores
this number was not null-terminated.  Indeed, 1814 / 720 gives us
2.519444444 (6 4's), but only 2.51944444 (5 4's) is displayed.  When we
begin to multiply by 300, the final 4 remained, and so we really were
multiplying by 3004.
2018-08-29 23:14:02 -04:00
Doug Torrance 66ea05ae67 wmcalc: Increase significant digits.
Patch by Antony Gelberg <antony@wayforth.co.uk> to fix Debian bug #320597 [1].
Obtained from the Debian package [2].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=320597
[2] https://sources.debian.net/src/wmcalc/0.5-1/debian/patches/10_bts-320597_increase_significant_digits.patch/
2015-08-23 08:35:36 +01:00
Doug Torrance 6b282a4b4d wmcalc: Remove trailing whitespace. 2015-01-10 19:02:57 +00:00
Doug Torrance 587fe05cc1 wmcalc: Fix -Wunused-result compiler warning. 2015-01-10 19:02:57 +00:00
Doug Torrance a50001bbe9 wmcalc: Add version 0.4 to repository.
Source obtained from:
ftp://ftp.afterstep.org/stable/rpms/misc-tarballs/wmcalc-0.4.tar.gz
2015-01-10 19:02:57 +00:00