12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package cpp;
- @:noPackageRestrict
- extern class NativeMath {
- #if (cpp && !cppia)
- @:native("_hx_idiv")
- static function idiv(num:Int, denom:Int):Int;
- @:native("_hx_imod")
- static function imod(num:Int, denom:Int):Int;
- @:native("_hx_cast_int")
- static function castInt(f:Float):Int;
- @:native("_hx_fast_floor")
- static function fastInt(f:Float):Int;
- #else
- static inline function imod(num:Int, denom:Int):Int
- return num % denom;
- static inline function idiv(num:Int, denom:Int):Int
- return Std.int(num / denom);
- static inline function castInt(f:Float):Int
- return Std.int(f);
- static inline function fastInt(f:Float):Int
- return Std.int(f);
- #end
- }
|