examples

i64

An AssemblyScript example. Exposes WebAssembly’s i64 operations to JavaScript using 32-bit integers (low and high bits).

Usage

import * as i64 from "path/to/i64";

i64.div(10, 0, 2, 0);

console.log("result: lo=" + i64.getLo() + ", hi=" + i64.getHi());

API

Note that u32 is just an alias of number in JavaScript with values in 32-bit integer range.

Building

To build assembly/i64.ts to an untouched and an optimized .wasm including their respective .wat representations, run:

$> npm run asbuild

Afterwards, to run the included test:

$> npm test