starling-framework
Version:
A fast, productive library for 2D cross-platform development.
185 lines (167 loc) • 4.01 kB
JavaScript
// Class: _UInt.UInt_Impl_
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../hxClasses_stub").default;
var $hxEnums = require("./../hxEnums_stub").default;
var $import = require("./../import_stub").default;
function Std() {return require("./../Std");}
// Constructor
var UInt_Impl_ = function(){}
// Meta
UInt_Impl_.__name__ = "_UInt.UInt_Impl_";
UInt_Impl_.__isInterface__ = false;
UInt_Impl_.prototype = {
};
UInt_Impl_.prototype.__class__ = UInt_Impl_.prototype.constructor = $hxClasses["_UInt.UInt_Impl_"] = UInt_Impl_;
// Init
// Statics
UInt_Impl_.add = function(a,b) {
return a + b;
}
UInt_Impl_.div = function(a,b) {
return UInt_Impl_.toFloat(a) / UInt_Impl_.toFloat(b);
}
UInt_Impl_.mul = function(a,b) {
return a * b;
}
UInt_Impl_.sub = function(a,b) {
return a - b;
}
UInt_Impl_.gt = function(a,b) {
var aNeg = a < 0;
var bNeg = b < 0;
if(aNeg != bNeg) {
return aNeg;
} else {
return a > b;
}
}
UInt_Impl_.gte = function(a,b) {
var aNeg = a < 0;
var bNeg = b < 0;
if(aNeg != bNeg) {
return aNeg;
} else {
return a >= b;
}
}
UInt_Impl_.lt = function(a,b) {
return UInt_Impl_.gt(b,a);
}
UInt_Impl_.lte = function(a,b) {
return UInt_Impl_.gte(b,a);
}
UInt_Impl_.and = function(a,b) {
return a & b;
}
UInt_Impl_.or = function(a,b) {
return a | b;
}
UInt_Impl_.xor = function(a,b) {
return a ^ b;
}
UInt_Impl_.shl = function(a,b) {
return a << b;
}
UInt_Impl_.shr = function(a,b) {
return a >>> b;
}
UInt_Impl_.ushr = function(a,b) {
return a >>> b;
}
UInt_Impl_.mod = function(a,b) {
return (Std().default).int(UInt_Impl_.toFloat(a) % UInt_Impl_.toFloat(b));
}
UInt_Impl_.addWithFloat = function(a,b) {
return UInt_Impl_.toFloat(a) + b;
}
UInt_Impl_.mulWithFloat = function(a,b) {
return UInt_Impl_.toFloat(a) * b;
}
UInt_Impl_.divFloat = function(a,b) {
return UInt_Impl_.toFloat(a) / b;
}
UInt_Impl_.floatDiv = function(a,b) {
return a / UInt_Impl_.toFloat(b);
}
UInt_Impl_.subFloat = function(a,b) {
return UInt_Impl_.toFloat(a) - b;
}
UInt_Impl_.floatSub = function(a,b) {
return a - UInt_Impl_.toFloat(b);
}
UInt_Impl_.gtFloat = function(a,b) {
return UInt_Impl_.toFloat(a) > b;
}
UInt_Impl_.equalsInt = function(a,b) {
return a == b;
}
UInt_Impl_.notEqualsInt = function(a,b) {
return a != b;
}
UInt_Impl_.equalsFloat = function(a,b) {
return UInt_Impl_.toFloat(a) == b;
}
UInt_Impl_.notEqualsFloat = function(a,b) {
return UInt_Impl_.toFloat(a) != b;
}
UInt_Impl_.gteFloat = function(a,b) {
return UInt_Impl_.toFloat(a) >= b;
}
UInt_Impl_.floatGt = function(a,b) {
return a > UInt_Impl_.toFloat(b);
}
UInt_Impl_.floatGte = function(a,b) {
return a >= UInt_Impl_.toFloat(b);
}
UInt_Impl_.ltFloat = function(a,b) {
return UInt_Impl_.toFloat(a) < b;
}
UInt_Impl_.lteFloat = function(a,b) {
return UInt_Impl_.toFloat(a) <= b;
}
UInt_Impl_.floatLt = function(a,b) {
return a < UInt_Impl_.toFloat(b);
}
UInt_Impl_.floatLte = function(a,b) {
return a <= UInt_Impl_.toFloat(b);
}
UInt_Impl_.modFloat = function(a,b) {
return UInt_Impl_.toFloat(a) % b;
}
UInt_Impl_.floatMod = function(a,b) {
return a % UInt_Impl_.toFloat(b);
}
UInt_Impl_.negBits = function(this1) {
return ~this1;
}
UInt_Impl_.prefixIncrement = function(this1) {
return ++this1;
}
UInt_Impl_.postfixIncrement = function(this1) {
return this1++;
}
UInt_Impl_.prefixDecrement = function(this1) {
return --this1;
}
UInt_Impl_.postfixDecrement = function(this1) {
return this1--;
}
UInt_Impl_.toString = function(this1,radix) {
return (Std().default).string(this1 == null ? null : UInt_Impl_.toFloat(this1));
}
UInt_Impl_.toInt = function(this1) {
return this1;
}
UInt_Impl_.toFloat = function(this1) {
var int = this1;
if(int < 0) {
return 4294967296.0 + int;
} else {
return int + 0.0;
}
}
// Export
exports.default = UInt_Impl_;