/*
 * D2F
 * Copyright (C) SatisKia. All rights reserved.
 */

#include "_Global.h"

class _Math
{
	static function div( a:Number, b:Number ):Number
	{
		if( a < 0 )
		{
			return Math.ceil( a / b );
		}
		return Math.floor( a / b );
	}

	static function mod( a:Number, b:Number ):Number
	{
		if( a < 0 )
		{
			a = -a;
			return -(a - Math.floor( a / b ) * b);
		}
		return a - Math.floor( a / b ) * b;
	}

	static function int( value:Number ):Number
	{
		if( value < 0 )
		{
			return Math.ceil( value );
		}
		return Math.floor( value );
	}
}
