lvm.js

changeset 143
a689e0187ef5
parent 142
574e0baea136
equal deleted inserted replaced
142:574e0baea136 143:a689e0187ef5
848 }, 848 },
849 frexp: function (x) 849 frexp: function (x)
850 { 850 {
851 var m = x.value; 851 var m = x.value;
852 var e = 0; 852 var e = 0;
853 while (Math.abs(m) >= 1) { 853 if(m != 0) {
854 m = m / 2; 854 while (Math.abs(m) < 0.5) {
855 e = e + 1; 855 m = m * 2;
856 }; 856 e = e - 1;
857 }
858 while (Math.abs(m) >= 1) {
859 m = m / 2;
860 e = e + 1;
861 }
862 }
857 return [this.LValue(m), this.LValue(e)]; 863 return [this.LValue(m), this.LValue(e)];
858 }, 864 },
859 floor: function (x) 865 floor: function (x)
860 { 866 {
861 return [this.LValue(Math.floor(x.value))]; 867 return [this.LValue(Math.floor(x.value))];

mercurial