bugAVR C Runtime Library - Bugs: bug #14852, fp pow function broken for...

 
 

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

bug #14852: fp pow function broken for negative x

Submitter:  None
Submitted:  Mon 24 Oct 2005 09:36:04 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  joerg_wunsch
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Sat 19 Nov 2005 09:34:23 PM UTC, comment #1: 

The new pow.S has been implemented.

isfinite.S not yet done, please resubmit with a proper
copyright notice.

Joerg Wunsch <joerg_wunsch>
Group administrator
Mon 24 Oct 2005 09:36:04 PM UTC, original submission:  

I believe the implementation of pow is inconsistent with the standard POSIX definition. The one provided by avr libc assumes x>0 so that it can approximate x^y with exp( log(x) * y).

The POSIX definition allows x<0, provided that y is integral valued.

In my case, I was computing a euclidean distance ((x1-x0)^2 + (y1-y0)^2), using pow for no good reason, but it crashed the atmel with an apparant stack overflow. (Presumably log(x) is ill-behaved for x<0).

x<0 could be relatively easily handled with a little wrapper which computes pow (abs(x), y) * (-1 if y is odd).

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #2707:  pow-20051108.tar.gz added by joerg_wunsch (12KiB - application/gzip - patch submitted by Dmitry K.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-11-19 joerg_wunsch StatusNone Fixed
    Assigned toNone joerg_wunsch
    Open/ClosedOpen Closed
2005-11-08 joerg_wunsch Attached File- Added pow-20051108.tar.gz, #3091
2005-10-24 None Carbon-Copy- Added eolson --AT-- mit --DOT-- edu

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code