/*global DARTY */
DARTY = DARTY || {};
DARTY.util = DARTY.util || {};
// <dependencies checking>
(function(){// Depends on Init.js
    var from = "DARTY.util.Number";
    var libs = ["DARTY.util.Init"];    
	if (DARTY && DARTY.util && DARTY.util.required) {    
        DARTY.util.required(libs, from);
    }
    else {
        if(DARTY && DARTY.DEBUG) {	
        	alert("Missing library : DARTY.util.Init in " + from);
        }	
    }
})();
// </dependencies checking>
DARTY.util.Number = function(){	
    ///////////////////////////////////////////////
    //  Initialisation     
    //////////////////////////////////////////////
    // extract just the integer part of a number
    // exemple : (-10/3).integer(); // -3
    Number.method('integer', function(){
        return Math[this < 0 ? 'ceil' : 'floor'](this);
    });
    
    var isNumber = function(value){
        return typeof value === 'number' && isFinite(value);
    };
    
    ///////////////////////////////////////////////
    // ------------- public properties & methods     
    //////////////////////////////////////////////
    return {
        isNumber: isNumber
    };
}();
