Ignore:
Timestamp:
12/09/06 22:45:39 (18 years ago)
Author:
r2d
Message:
  • removed slow builtin_ functions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/branches/r2d/include/mpc/mpcmath.h

    r137 r156  
    1717 */
    1818
     19#include <mpc/mpc_types.h>
    1920
    2021#ifndef M_PI
     
    5859#define ATAN2F(x,y)  ATAN2 (x,y)
    5960#define IFLOORF(x)   IFLOOR (x)
     61
     62typedef union mpc_floatint
     63{
     64        float   f;
     65        mpc_int32_t n;
     66} mpc_floatint;
     67
     68static mpc_inline mpc_int32_t mpc_lrintf(float fVal)
     69{
     70        mpc_floatint tmp;
     71        tmp.f = fVal  + 0x00FF8000;
     72        return tmp.n - 0x4B7F8000;
     73}
     74
     75static mpc_inline float mpc_nearbyintf(float fVal)
     76{
     77        return (float) mpc_lrintf(fVal);
     78}
     79
Note: See TracChangeset for help on using the changeset viewer.