Created
May 5, 2015 13:18
-
-
Save adityasharat/c83386ba0ce222061b67 to your computer and use it in GitHub Desktop.
Create a Math Utility
This file contains 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
var Math = {}; | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E | |
Math.E = 2.718; | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max | |
Math.max = function (x, y) { | |
if (x > y) { | |
return x; | |
} else { | |
return y; | |
} | |
}; | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI | |
Math.PI = | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs | |
Math.abs = | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil | |
Math.ceil = | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor | |
Math.floor = | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min | |
Math.min = | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow | |
Math.pow = | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round | |
Math.round = |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment