emul/mini/src/main/resources/org/apidesign/vm4brwsr/emul/lang/java_lang_Number.js
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 23 Jan 2013 20:52:11 +0100
branchemul
changeset 555 cde0c2d7794e
parent 554 emul/mini/src/main/resources/org/apidesign/vm4brwsr/emul/java_lang_Number.js@05224402145d
child 593 b42911b78a16
permissions -rw-r--r--
Using specific subpackages rather than generic org.apidesign.bck2brwsr.emul
     1 // empty line needed here
     2 Number.prototype.add32 = function(x) { return (this + x) | 0; };
     3 Number.prototype.sub32 = function(x) { return (this - x) | 0; };
     4 Number.prototype.mul32 = function(x) { 
     5     return (((this * (x >> 16)) << 16) + this * (x & 0xFFFF)) | 0;
     6 };
     7 
     8 Number.prototype.toInt8 = function()  { return (this << 24) >> 24; };
     9 Number.prototype.toInt16 = function() { return (this << 16) >> 16; };