• Parameters

    • target: number

      number to calculate ULP for

    • mode: FlushMode = 'flush'

      should FTZ occurring during calculation or not

    Returns number

    ulp(x), the unit of least precision for a specific number as a 32-bit float

    ulp(x) is the distance between the two floating point numbers nearest x. This value is also called unit of last place, ULP, and 1 ULP. See the WGSL spec and http://www.ens-lyon.fr/LIP/Pub/Rapports/RR/RR2005/RR2005-09.pdf for a more detailed/nuanced discussion of the definition of ulp(x).

Generated using TypeDoc