Skip to content

Commit 8ba39e2

Browse files
authored
Disable 64 bit float encoding (#82)
1 parent c86f7b7 commit 8ba39e2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/messaging/Message.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ export namespace Message {
177177
let payload: string = '';
178178
args.forEach((arg: Value<Type>) => {
179179
if (arg.type === Float.f32 || arg.type === Float.f64 || arg.type === Special.nan || arg.type === Special.infinity) {
180-
const buff = Buffer.alloc(arg.type === Float.f32 ? 4 : 8);
181-
write(buff, Number(arg.value), 0, true, arg.type === Float.f32 ? 23 : 52, buff.length); // todo fix precision loss
180+
const buff = Buffer.alloc(4);
181+
write(buff, Number(arg.value), 0, true, 23, buff.length); // todo fix precision loss
182182
payload += buff.toString('hex');
183183
} else {
184184
payload += WASM.leb128(arg.value);

0 commit comments

Comments
 (0)