[project @ Corrected bugs in SIGNIFICANT-FIGURES-EQUAL related to values of zero.]
commit050a28cb48678bfcf1ece4aa95c2ae80a06da82f
authorThomas M. Hermann <tmh.public@gmail.com>
Fri, 6 Mar 2009 03:26:22 +0000 (6 03:26 +0000)
committerThomas M. Hermann <tmh.public@gmail.com>
Fri, 6 Mar 2009 03:26:22 +0000 (6 03:26 +0000)
treedb70bf4885ca2fe51ac040d01a42a978b6e89979
parent6c89e10d4c098660acc3f92155d7c357dd59196e
[project @ Corrected bugs in SIGNIFICANT-FIGURES-EQUAL related to values of zero.]

The SIGNIFICANT-FIGURES-EQUAL and NORMALIZE-FLOAT functions failed for
values of or near zero. The 2 primary changes in this patch corrected
those functions. In the process, it was recognized that a
multiplication using the value 0.1 was being performed in
NORMALIZE-FLOAT instead of dividing by 10.0. Repeatedly multiplying a
number by 0.1, which cannot be exactly represented by a floating point
number, caused an error to accumulate in the number. Dividing by 10.0
eliminates this error at the expense of computational
performance. Unless there is a compelling reason, always choose
correctness over performance. Finally, another convenience function,
2-SIGFIG-EQUAL, was added.
lisp-unit.lisp