mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-14 15:31:31 +00:00
Add Math.signbit (#333)
This commit is contained in:
@ -4,6 +4,9 @@ var globalScope = typeof window !== "undefined" && window || typeof global !== "
|
||||
|
||||
globalScope.ASC_TARGET = 0;
|
||||
|
||||
var F64 = new Float64Array(1);
|
||||
var U64 = new Uint32Array(F64.buffer);
|
||||
|
||||
Object.defineProperties(
|
||||
globalScope["i8"] = function i8(value) { return value << 24 >> 24; }
|
||||
, {
|
||||
@ -210,7 +213,7 @@ globalScope["isString"] = function isString(arg) {
|
||||
|
||||
globalScope["isArray"] = Array.isArray;
|
||||
|
||||
globalScope["unchecked"] = function(expr) {
|
||||
globalScope["unchecked"] = function unchecked(expr) {
|
||||
return expr;
|
||||
};
|
||||
|
||||
@ -223,6 +226,9 @@ globalScope["fmodf"] = function fmodf(x, y) {
|
||||
};
|
||||
|
||||
globalScope["JSMath"] = Math;
|
||||
globalScope["JSMath"].signbit = function signbit(x) {
|
||||
F64[0] = x; return Boolean((U64[1] >>> 31) & (x == x));
|
||||
}
|
||||
|
||||
globalScope["memory"] = (() => {
|
||||
var HEAP = new Uint8Array(0);
|
||||
|
Reference in New Issue
Block a user