How to use the @webassemblyjs/ieee754.encodeF64 function in @webassemblyjs/ieee754

To help you get started, we’ve selected a few @webassemblyjs/ieee754 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flaviuse / mern-authentication / client / node_modules / @webassemblyjs / wasm-gen / esm / encoder / index.js View on Github external
var encoder = encodeU32; // find correct encoder

      if (n.object === "i32") {
        encoder = encodeI32;
      }

      if (n.object === "i64") {
        encoder = encodeI64;
      }

      if (n.object === "f32") {
        encoder = ieee754.encodeF32;
      }

      if (n.object === "f64") {
        encoder = ieee754.encodeF64;
      }

      if (arg.type === "NumberLiteral" || arg.type === "FloatLiteral" || arg.type === "LongNumberLiteral") {
        // $FlowIgnore
        out.push.apply(out, _toConsumableArray(encoder(arg.value)));
      } else {
        throw new Error("Unsupported instruction argument encoding " + JSON.stringify(arg.type));
      }
    });
  }
github zc910704 / Vue.js-personal-note / www / day6.1.webpack的url-loader与babel / node_modules / @webassemblyjs / wasm-gen / esm / encoder / index.js View on Github external
var encoder = encodeU32; // find correct encoder

      if (n.object === "i32") {
        encoder = encodeI32;
      }

      if (n.object === "i64") {
        encoder = encodeI64;
      }

      if (n.object === "f32") {
        encoder = ieee754.encodeF32;
      }

      if (n.object === "f64") {
        encoder = ieee754.encodeF64;
      }

      if (arg.type === "NumberLiteral" || arg.type === "FloatLiteral" || arg.type === "LongNumberLiteral") {
        // $FlowIgnore
        out.push.apply(out, _toConsumableArray(encoder(arg.value)));
      } else {
        throw new Error("Unsupported instruction argument encoding " + JSON.stringify(arg.type));
      }
    });
  }
github xtuc / webassemblyjs / packages / wasm-gen / src / encoder / index.js View on Github external
// find correct encoder
      if (n.object === "i32") {
        encoder = encodeI32;
      }

      if (n.object === "i64") {
        encoder = encodeI64;
      }

      if (n.object === "f32") {
        encoder = ieee754.encodeF32;
      }

      if (n.object === "f64") {
        encoder = ieee754.encodeF64;
      }

      if (
        arg.type === "NumberLiteral" ||
        arg.type === "FloatLiteral" ||
        arg.type === "LongNumberLiteral"
      ) {
        // $FlowIgnore
        out.push(...encoder(arg.value));
      } else {
        throw new Error(
          "Unsupported instruction argument encoding " +
            JSON.stringify(arg.type)
        );
      }
    });

@webassemblyjs/ieee754

IEEE754 decoder and encoder

MIT
Latest version published 2 days ago

Package Health Score

81 / 100
Full package analysis

Similar packages