Skip to content

WasmVM: long double precision missing in WASM (strtold, wcstold, printf %Lf) #38

@NathanFlurry

Description

@NathanFlurry

Summary

WASM uses 64-bit IEEE 754 doubles for both double and long double — there is no 80-bit extended precision. This causes strtold(), wcstold(), and printf with %Lf format specifier to produce incorrect results compared to native x86-64 which has 80-bit long double.

Affected os-test cases

  • basic/stdlib/strtold
  • basic/wchar/wcstold
  • stdio/printf-Lf-width-precision-pos-args

Expected behavior

Long double operations should produce correct results within the limitations of 64-bit double precision, or tests should document the precision difference.

Context

This is a fundamental WASM platform limitation — the wasm32 target maps long double to double (64-bit). Discovered via os-test POSIX conformance suite. Tracked in posix-exclusions.json as fail / patched-sysroot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions