diff --git a/src/messaging/Message.ts b/src/messaging/Message.ts index 888570d..62c54dd 100644 --- a/src/messaging/Message.ts +++ b/src/messaging/Message.ts @@ -177,8 +177,8 @@ export namespace Message { let payload: string = ''; args.forEach((arg: Value) => { if (arg.type === Float.f32 || arg.type === Float.f64 || arg.type === Special.nan || arg.type === Special.infinity) { - const buff = Buffer.alloc(arg.type === Float.f32 ? 4 : 8); - write(buff, Number(arg.value), 0, true, arg.type === Float.f32 ? 23 : 52, buff.length); // todo fix precision loss + const buff = Buffer.alloc(4); + write(buff, Number(arg.value), 0, true, 23, buff.length); // todo fix precision loss payload += buff.toString('hex'); } else { payload += WASM.leb128(arg.value);