6 description: Contains Number Prototypes like limit, round, times, and ceil.
8 license: MIT-style license.
21 limit: function(min, max){
22 return Math.min(max, Math.max(min, this));
25 round: function(precision){
26 precision = Math.pow(10, precision || 0);
27 return Math.round(this * precision) / precision;
30 times: function(fn, bind){
31 for (var i = 0; i < this; i++) fn.call(bind, i, this);
35 return parseFloat(this);
38 toInt: function(base){
39 return parseInt(this, base || 10);
44 Number.alias('times', 'each');
48 math.each(function(name){
49 if (!Number[name]) methods[name] = function(){
50 return Math[name].apply(null, [this].concat($A(arguments)));
53 Number.implement(methods);
54 })(['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'sin', 'sqrt', 'tan']);