Changeset 787

Show
Ignore:
Timestamp:
09/30/06 23:05:57 (2 years ago)
Author:
dnehring
Message:

fix for broken rintf() function

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/toolchain/libnotimpl/files/math.c

    r1 r787  
    88 * wrapper for cos(x) 
    99 */ 
    10  
    11 #ifdef __STDC__ 
    12         float cosf(float x) 
    13 #else 
    14         float cosf(x) 
    15         float x; 
    16 #endif 
    17 
     10float cosf(float x) { 
    1811        return (float) cos( (double)x ); 
    1912} 
     
    2417 * wrapper for sin(x) 
    2518 */ 
    26  
    27 #ifdef __STDC__ 
    28         float sinf(float x) 
    29 #else 
    30         float sinf(x) 
    31         float x; 
    32 #endif 
    33 
     19float sinf(float x) { 
    3420        return (float) sin( (double)x ); 
    3521} 
     
    4026 * wrapper for ceil(x) 
    4127 */ 
    42  
    43 #ifdef __STDC__ 
    44         float ceilf(float x) 
    45 #else 
    46         float ceilf(x) 
    47         float x; 
    48 #endif 
    49 
     28float ceilf(float x) { 
    5029        return (float) ceil( (double)x ); 
    5130} 
    5231 
    53  
    5432/* rintf for uClibc 
    5533 * 
    56  * wrapper for rint(x) 
     34 * wrapper for rint(x), workaround with ceil 
    5735 */ 
    58  
    59 #ifdef __STDC__ 
    60         float rintf(float x) 
    61 #else 
    62         float rintf(x) 
    63         float x; 
    64 #endif 
    65 
    66         return (float) rint( (double)x ); 
     36float rintf(float x) { 
     37        return (float) ceil( (double)x - 0.5); 
    6738} 
    68