Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: third_party/WebKit/Source/wtf/MathExtras.h

Issue 2559063002: Don't define log2 and log2f in blink (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 const double piOverTwoDouble = M_PI_2; 53 const double piOverTwoDouble = M_PI_2;
54 const float piOverTwoFloat = static_cast<float>(M_PI_2); 54 const float piOverTwoFloat = static_cast<float>(M_PI_2);
55 55
56 const double piOverFourDouble = M_PI_4; 56 const double piOverFourDouble = M_PI_4;
57 const float piOverFourFloat = static_cast<float>(M_PI_4); 57 const float piOverFourFloat = static_cast<float>(M_PI_4);
58 58
59 const double twoPiDouble = piDouble * 2.0; 59 const double twoPiDouble = piDouble * 2.0;
60 const float twoPiFloat = piFloat * 2.0f; 60 const float twoPiFloat = piFloat * 2.0f;
61 61
62 #if OS(ANDROID) || COMPILER(MSVC) 62 #if OS(ANDROID)
63 // ANDROID and MSVC's math.h does not currently supply log2 or log2f. 63 // ANDROID's math.h does not currently supply log2 or log2f.
64 inline double log2(double num) { 64 inline double log2(double num) {
65 // This constant is roughly M_LN2, which is not provided by default on Windows 65 // This constant is roughly M_LN2, which is not provided by default on Windows
66 // and Android. 66 // and Android.
67 return log(num) / 0.693147180559945309417232121458176568; 67 return log(num) / 0.693147180559945309417232121458176568;
68 } 68 }
69 69
70 inline float log2f(float num) { 70 inline float log2f(float num) {
71 // This constant is roughly M_LN2, which is not provided by default on Windows 71 // This constant is roughly M_LN2, which is not provided by default on Windows
72 // and Android. 72 // and Android.
73 return logf(num) / 0.693147180559945309417232121458176568f; 73 return logf(num) / 0.693147180559945309417232121458176568f;
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 if (i >> 2) 441 if (i >> 2)
442 log2 += 2, i >>= 2; 442 log2 += 2, i >>= 2;
443 if (i >> 1) 443 if (i >> 1)
444 log2 += 1; 444 log2 += 1;
445 return log2; 445 return log2;
446 } 446 }
447 447
448 } // namespace WTF 448 } // namespace WTF
449 449
450 #endif // #ifndef WTF_MathExtras_h 450 #endif // #ifndef WTF_MathExtras_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698