emul/mini/src/main/resources/org/apidesign/vm4brwsr/emul/java_lang_Number.js
branchemul
changeset 554 05224402145d
parent 445 9e4f01dd6acb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/emul/mini/src/main/resources/org/apidesign/vm4brwsr/emul/java_lang_Number.js	Wed Jan 23 20:39:23 2013 +0100
     1.3 @@ -0,0 +1,9 @@
     1.4 +// empty line needed here
     1.5 +Number.prototype.add32 = function(x) { return (this + x) | 0; };
     1.6 +Number.prototype.sub32 = function(x) { return (this - x) | 0; };
     1.7 +Number.prototype.mul32 = function(x) { 
     1.8 +    return (((this * (x >> 16)) << 16) + this * (x & 0xFFFF)) | 0;
     1.9 +};
    1.10 +
    1.11 +Number.prototype.toInt8 = function()  { return (this << 24) >> 24; };
    1.12 +Number.prototype.toInt16 = function() { return (this << 16) >> 16; };
    1.13 \ No newline at end of file