Changeset 1041 for trunk/src/half.h


Ignore:
Timestamp:
Oct 31, 2011, 9:19:09 AM (9 years ago)
Author:
sam
Message:

core: new combinations of integer vectors (unsigned, 8-bit, etc.), dot and
cross product, normalize, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/half.h

    r882 r1041  
    2929     * instead of calling routines with the hidden "this" parameter. */
    3030    inline half() { }
     31    inline half(int f) { *this = makefast(f); }
    3132    inline half(float f) { *this = makefast(f); }
     33    inline half(double f) { *this = makefast(f); }
    3234
    3335    inline int is_nan() const
     
    5153    }
    5254
    53     /* Cast to other types */
     55    /* Cast to other types -- always inline, see constructors */
     56    inline half &operator =(int f) { return *this = makefast(f); }
     57    inline half &operator =(float f) { return *this = makefast(f); }
     58    inline half &operator =(double f) { return *this = makefast(f); }
     59    inline operator int() const { return (int)tofloat(*this); }
    5460    inline operator float() const { return tofloat(*this); }
    55     inline operator int() const { return (int)tofloat(*this); }
    5661
    5762    static float tofloat(half h);
Note: See TracChangeset for help on using the changeset viewer.