844 var math = { |
844 var math = { |
845 ldexp: function (m, e) |
845 ldexp: function (m, e) |
846 { |
846 { |
847 return [this.LValue(m.value*Math.pow(2, e.value))]; |
847 return [this.LValue(m.value*Math.pow(2, e.value))]; |
848 }, |
848 }, |
|
849 frexp: function (x) |
|
850 { |
|
851 var m = x.value; |
|
852 var e = 0; |
|
853 while (Math.abs(m) >= 1) { |
|
854 m = m / 2; |
|
855 e = e + 1; |
|
856 }; |
|
857 return [this.LValue(m), this.LValue(e)]; |
|
858 }, |
849 floor: function (x) |
859 floor: function (x) |
850 { |
860 { |
851 return [this.LValue(Math.floor(x.value))]; |
861 return [this.LValue(Math.floor(x.value))]; |
852 } |
862 } |
853 }; |
863 }; |