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

 
 

bug #14852: fp pow function broken for negative x

Submitted by:  None
Submitted on:  Mon 24 Oct 2005 09:36:04 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedPercent Complete: 0%
Assigned to: Joerg Wunsch <joerg_wunsch>Originator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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.)

Attach File(s):
   
   
Comment:
   

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

 

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

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 19 Nov 2005 09:34:23 PM UTCjoerg_wunschStatusNone=>Fixed
  Assigned toNone=>joerg_wunsch
  Open/ClosedOpen=>Closed
Tue 08 Nov 2005 10:31:53 PM UTCjoerg_wunschAttached File-=>Added pow-20051108.tar.gz, #3091
Mon 24 Oct 2005 09:36:04 PM UTCNoneCarbon-Copy-=>Added eolson --AT-- mit --DOT-- edu

Back to the top


Powered by Savane 3.1-cleanup1