bugAxiom Computer Algebra System - Bugs: bug #4565, log10 in GCL returns a bad value...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #4565: log10 in GCL returns a bad value for log10(1000)

Submitted by:  David Mentré <dmentre>
Submitted on:  Thu 31 Jul 2003 05:25:43 PM UTC  
 
Category: interpreterSeverity: 2 - Minor
Item Group: code bugStatus: transferred
Privacy: PublicAssigned to: None
Originator Name: Joergen WeissOpen/Closed: Open
Release:  Friday July 18, 2003 at 13:33:22Reproducibility: None
Fixed Release: 
Error message: 
Example of code trigerring the bug: 

)lisp (log10 1000)

Internal cause: 

Fri 05 Sep 2003 04:23:00 PM UTC, comment #3:
[Added information or comment]

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>
Project Administrator
Thu 04 Sep 2003 07:54:19 PM UTC, comment #2:
[Added information or comment]

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>
Project Administrator
Wed 03 Sep 2003 08:58:48 PM UTC, comment #1:
[Added information or comment]

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

David Mentré <dmentre>
Project Administrator
Thu 31 Jul 2003 05:25:43 PM UTC, original submission:

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)

David Mentré <dmentre>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 26 Jan 2005 07:37:10 AM UTCbillpage1StatusNone=>transferred
Thu 04 Sep 2003 07:54:19 PM UTCdmentreSeverity3 - Normal=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup