| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 const double piDouble = M_PI; | 43 const double piDouble = M_PI; |
| 44 const float piFloat = static_cast<float>(M_PI); | 44 const float piFloat = static_cast<float>(M_PI); |
| 45 | 45 |
| 46 const double piOverTwoDouble = M_PI_2; | 46 const double piOverTwoDouble = M_PI_2; |
| 47 const float piOverTwoFloat = static_cast<float>(M_PI_2); | 47 const float piOverTwoFloat = static_cast<float>(M_PI_2); |
| 48 | 48 |
| 49 const double piOverFourDouble = M_PI_4; | 49 const double piOverFourDouble = M_PI_4; |
| 50 const float piOverFourFloat = static_cast<float>(M_PI_4); | 50 const float piOverFourFloat = static_cast<float>(M_PI_4); |
| 51 | 51 |
| 52 const double twoPiDouble = piDouble * 2.0; |
| 53 const float twoPiFloat = piFloat * 2.0f; |
| 54 |
| 52 #if OS(MACOSX) | 55 #if OS(MACOSX) |
| 53 | 56 |
| 54 // Work around a bug in the Mac OS X libc where ceil(-0.1) return +0. | 57 // Work around a bug in the Mac OS X libc where ceil(-0.1) return +0. |
| 55 inline double wtf_ceil(double x) { return copysign(ceil(x), x); } | 58 inline double wtf_ceil(double x) { return copysign(ceil(x), x); } |
| 56 | 59 |
| 57 #define ceil(x) wtf_ceil(x) | 60 #define ceil(x) wtf_ceil(x) |
| 58 | 61 |
| 59 #endif | 62 #endif |
| 60 | 63 |
| 61 #if OS(OPENBSD) | 64 #if OS(OPENBSD) |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 if (i >> 2) | 309 if (i >> 2) |
| 307 log2 += 2, i >>= 2; | 310 log2 += 2, i >>= 2; |
| 308 if (i >> 1) | 311 if (i >> 1) |
| 309 log2 += 1; | 312 log2 += 1; |
| 310 return log2; | 313 return log2; |
| 311 } | 314 } |
| 312 | 315 |
| 313 } // namespace WTF | 316 } // namespace WTF |
| 314 | 317 |
| 315 #endif // #ifndef WTF_MathExtras_h | 318 #endif // #ifndef WTF_MathExtras_h |
| OLD | NEW |