bugAVR C Runtime Library - Bugs: bug #26809, Some common math constants missing...

 
 

bug #26809: Some common math constants missing in math.h

Submitted by:  Gabriel Anzziani <ganzziani>
Submitted on:  Mon 15 Jun 2009 01:11:52 PM UTC  
 
Category:  Header Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Header files
Status:  Fixed Assigned to:  Dmitry Xmelkov <dmix>
Percent Complete:  100% Open/Closed:  Closed
Release:  1.6.6 Fixed Release:  None

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Sun 28 Jun 2009 09:23:04 PM UTC, comment #2: 

A set of constants (from Glibc) is added to 1_6 and HEAD branches.

Dmitry Xmelkov <dmix>
Project AdministratorIn charge of this item.
Tue 16 Jun 2009 09:42:17 PM UTC, comment #1: 

In general, agree.
But I am not shure about the necessity of macroses like M_PI_2: the Avr-gcc
precalculates the constant expressions regardless of optimization level.
(Note, the C99 standart does not demand any math constants.)

Dmitry Xmelkov <dmix>
Project AdministratorIn charge of this item.
Mon 15 Jun 2009 01:11:52 PM UTC, original submission:  

Only M_PI and M_SQRT2 are defined in math.h, but all these should be defined:

#define M_E 2.7182818284590452354 /* e */
#define M_LOG2E 1.4426950408889634074 /* log 2e */
#define M_LOG10E 0.43429448190325182765 /* log 10e */
#define M_LN2 0.69314718055994530942 /* log e2 */
#define M_LN10 2.30258509299404568402 /* log e10 */
#define M_PI 3.14159265358979323846 /* pi */
#define M_PI_2 1.57079632679489661923 /* pi/2 */
#define M_PI_4 0.78539816339744830962 /* pi/4 */
#define M_1_PI 0.31830988618379067154 /* 1/pi */
#define M_2_PI 0.63661977236758134308 /* 2/pi */
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */

Gabriel Anzziani <ganzziani>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dmix (Posted a comment)
  • -email is unavailable- added by ganzziani (Submitted the item)
  •  

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-06-28 dmix StatusNone => Fixed
        Percent Complete0% => 100%
        Open/ClosedOpen => Closed
    2009-06-16 dmix Assigned toNone => dmix

    Back to the top


    Powered by Savane 3.5