这是indexloc提供的服务,不要输入任何密码
Skip to content

Proposal: Support C99 hex float literals to accurately capture float values #709

@dneto0

Description

@dneto0

Originally: gpuweb/WSL#351

Decimal notation for floating point numbers is fine for common cases, but confusingly lossy. E.g. 1.5 vs. 1.3
Sometimes you really want to control exactly which floating point number is used, e.g. for mathematical constants like approximations to Pi, or for testing things like NaN-handling.

C99 hex float syntax is a worked-out absolutely unambiguous syntax for getting exactly the floating point numbers that you want. WGSL should support this additional syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issueswgsl resolvedResolved - waiting for a change to the WGSL specification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions