| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; | 52 const double twoPiDouble = piDouble * 2.0; |
| 53 const float twoPiFloat = piFloat * 2.0f; | 53 const float twoPiFloat = piFloat * 2.0f; |
| 54 | 54 |
| 55 #if OS(MACOSX) | |
| 56 | |
| 57 // Work around a bug in the Mac OS X libc where ceil(-0.1) return +0. | |
| 58 inline double wtf_ceil(double x) { return copysign(ceil(x), x); } | |
| 59 | |
| 60 #define ceil(x) wtf_ceil(x) | |
| 61 | |
| 62 #endif | |
| 63 | |
| 64 #if OS(OPENBSD) | 55 #if OS(OPENBSD) |
| 65 | 56 |
| 66 namespace std { | 57 namespace std { |
| 67 | 58 |
| 68 #ifndef isfinite | 59 #ifndef isfinite |
| 69 inline bool isfinite(double x) { return finite(x); } | 60 inline bool isfinite(double x) { return finite(x); } |
| 70 #endif | 61 #endif |
| 71 #ifndef signbit | 62 #ifndef signbit |
| 72 inline bool signbit(double x) { struct ieee_double *p = (struct ieee_double *)&x
; return p->dbl_sign; } | 63 inline bool signbit(double x) { struct ieee_double *p = (struct ieee_double *)&x
; return p->dbl_sign; } |
| 73 #endif | 64 #endif |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 if (i >> 2) | 325 if (i >> 2) |
| 335 log2 += 2, i >>= 2; | 326 log2 += 2, i >>= 2; |
| 336 if (i >> 1) | 327 if (i >> 1) |
| 337 log2 += 1; | 328 log2 += 1; |
| 338 return log2; | 329 return log2; |
| 339 } | 330 } |
| 340 | 331 |
| 341 } // namespace WTF | 332 } // namespace WTF |
| 342 | 333 |
| 343 #endif // #ifndef WTF_MathExtras_h | 334 #endif // #ifndef WTF_MathExtras_h |
| OLD | NEW |