Created
April 25, 2011 12:08
-
-
Save jney/940420 to your computer and use it in GitHub Desktop.
get every Math constants and functions in less.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if( '__proto__' in {} ) { | |
| tree.functions = Math.__proto__; | |
| } else { | |
| var mathFn = 'E LN2 LN10 LOG2E LOG10E PI SQRT1_2 SQRT2 abs acos asin atan atan2 ceil cos exp floor log max min pow random round sin sqrt tan'.split(' '); | |
| for (var i = 0; i < mathFn.length; i++) { | |
| tree.functions[mathFn[i]] = Math[mathFn[i]]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment