Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add log2 polyfill #4701

merged 2 commits into from Jun 26, 2019


Copy link

commented Jun 25, 2019

Re: cocos-creator/2d-tasks#1563


  • add log2 polyfill
@@ -8,6 +8,12 @@ if (!Math.sign) {

if (!Math.log2) {
Math.log2 = function (x) {
return Math.log(x) / 0.6931471805599453;

This comment has been minimized.

Copy link

jareguo Jun 26, 2019


改成 Math.log(x) * Math.LOG2E 吧?

@jareguo jareguo merged commit ddec790 into cocos-creator:v2.1.2 Jun 26, 2019

1 check passed

ci/circleci: test Your tests passed on CircleCI!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.