Ignore:
Timestamp:
Jan 2, 2013, 1:53:39 PM (7 years ago)
Author:
sam
Message:

math: implement fract() for vectors and scalar types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/math/math.h

    r2188 r2192  
    3333static inline double sqrt(double const &x) { return std::sqrt(x); }
    3434static inline float sqrt(float const &x) { return std::sqrt(x); }
     35
     36static inline double exp(double const &x) { return std::exp(x); }
     37static inline float exp(float const &x) { return std::exp(x); }
    3538
    3639static inline double sin(double const &x) { return std::sin(x); }
     
    139142static inline ldouble fmod(ldouble x, ldouble y) { return std::fmod(x, y); }
    140143
     144static inline uint8_t fract(uint8_t x) { return 0; }
     145static inline int8_t fract(int8_t x) { return 0; }
     146static inline uint16_t fract(uint16_t x) { return 0; }
     147static inline int16_t fract(int16_t x) { return 0; }
     148static inline uint32_t fract(uint32_t x) { return 0; }
     149static inline int32_t fract(int32_t x) { return 0; }
     150static inline uint64_t fract(uint64_t x) { return 0; }
     151static inline int64_t fract(int64_t x) { return 0; }
     152static inline float fract(float x) { return x - std::floor(x); }
     153static inline double fract(double x) { return x - std::floor(x); }
     154static inline ldouble fract(ldouble x) { return x - std::floor(x); }
     155
    141156static inline uint8_t min(uint8_t x, uint8_t y) { return std::min(x, y); }
    142157static inline int8_t min(int8_t x, int8_t y) { return std::min(x, y); }
Note: See TracChangeset for help on using the changeset viewer.