axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [#79 log10 in GCL returns a bad value for log10(1000)]


From: billpage
Subject: [Axiom-developer] [#79 log10 in GCL returns a bad value for log10(1000)] property change
Date: Wed, 26 Jan 2005 02:37:13 -0600

--removed:
-
-

--removed:
-
-    _______________________________________________________
-

??changed:
-  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=4565>
-
-_______________________________________________
-  Message sent via/by Savannah
-  http://savannah.nongnu.org/
http://savannah.nongnu.org/bugs/?func=detailitem&item_id=4565


In some versions of GCL the LOG10 function returns improperly rounded values.

The symptom is:
\begin{verbatim}
(24) -> [1000]
(24) [100]
\end{verbatim}

The common lisp failure can be shown with::

  (25) -> )lisp (log10 1000)
  Value = 2.9999999999999996

This previous boot code was::

  u < MOST_-POSITIVE_-LONG_-FLOAT => 1+negative+FLOOR LOG10 u
  and should be restored when the GCL bug is fixed.
  u < MOST_-POSITIVE_-LONG_-FLOAT => 1+negative+FLOOR ((LOG10 u) + 0.0000001)


Fri 09/05/2003 at 16:23, comment !#3

>From Tim:

I've already patched the output system to round (log10 1000).
The issue is still open because I need to remember to search
the sources for any other use of log10. I doubt we use it elsewhere
but I might as well do a quality job, yaknow?

David Mentré <dmentre>
Thu 09/04/2003 at 19:54, comment !#2:

>From Camm Maguire:
Our lisp spec expert tells me that routines returning floating point
values like (log10...) are not required to return exact integers in
cases like these.

What you want is something like this::

  (defun logi (x y &aux i r)
  (declare (longfloat x y r))
  (declare (fixnum i))
  (multiple-value-bind (i r) (round (log x y)) i))

David Mentré <dmentre>
Wed 09/03/2003 at 20:58, comment !#1:[Added information or comment]

Remind to tell about (log10 1000) issue on GCL developer mailing list.


Message sent via/by Savannah
http://savannah.nongnu.org/

++added:


--
forwarded from http://page.axiom-developer.org/zope/mathaction/address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]