Changeset 1181
- Timestamp:
- Mar 30, 2012, 10:48:45 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/math/half.cpp
r1180 r1181 2 2 // Lol Engine 3 3 // 4 // Copyright: (c) 2010-201 1Sam Hocevar <sam@hocevar.net>4 // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net> 5 5 // This program is free software; you can redistribute it and/or 6 6 // modify it under the terms of the Do What The Fuck You Want To … … 41 41 /* Lookup table-based algorithm from “Fast Half Float Conversions” 42 42 * by Jeroen van der Zijp, November 2008. No rounding is performed, 43 * and some NaN values may be incorrectly converted to Inf. */ 43 * and some NaN values may be incorrectly converted to Inf (because 44 * the lowest order bits in the mantissa are ignored). */ 44 45 static inline uint16_t float_to_half_nobranch(uint32_t x) 45 46 { … … 158 159 #endif 159 160 161 /* We use this De Bruijn sequence to compute a branchless integer log2 */ 160 162 static int const shifttable[32] = 161 163 {
Note: See TracChangeset
for help on using the changeset viewer.