componentized/directory

componentized:constants

interface dev

Create custom wasm components that export constant values.

interface f32 componentized:constants/f32@0.1.2-dev

Constants for the f32 floating point type.

Functions

functionradix: func() -> u32

The radix or base of the internal representation of f32. @value 2

functionmantissa-digits: func() -> u32

Number of significant digits in base 2. @value 24

functiondigits: func() -> u32

Approximate number of significant digits in base 10. @value 6

functionepsilon: func() -> f32

Machine epsilon value for f32, the difference between 1.0 and the next larger representable number. @value 1.19209290e-07

functionmin: func() -> f32

Smallest finite f32 value. @value -3.40282347e+38

functionmin-positive: func() -> f32

Smallest positive normal f32 value. @value 1.17549435e-38

functionmax: func() -> f32

Largest finite f32 value. @value 3.40282347e+38

functionmin-exp: func() -> s32

One greater than the minimum possible normal power of 2 exponent. @value -125

functionmax-exp: func() -> s32

Maximum possible power of 2 exponent. @value 128

functionmin-n10-exp: func() -> s32

Minimum x for which 10x is normal. @value -37

functionmax-n10-exp: func() -> s32

Maximum x for which 10x is normal. @value 38

functionnan: func() -> f32

Not a Number (NaN). @value nan

functioninfinity: func() -> f32

Infinity (∞). @value inf

functionneg-infinity: func() -> f32

Negative infinity (−∞). @value -inf

WIT

/// Constants for the `f32` floating point type.
interface %f32 {
  /// The radix or base of the internal representation of `f32`.
  /// @value 2
  radix: func() -> u32;

  /// Number of significant digits in base 2.
  /// @value 24
  mantissa-digits: func() -> u32;

  /// Approximate number of significant digits in base 10.
  /// @value 6
  digits: func() -> u32;

  /// Machine epsilon value for `f32`, the difference between `1.0` and the next larger representable number.
  /// @value 1.19209290e-07
  epsilon: func() -> f32;

  /// Smallest finite `f32` value.
  /// @value -3.40282347e+38
  min: func() -> f32;

  /// Smallest positive normal `f32` value.
  /// @value 1.17549435e-38
  min-positive: func() -> f32;

  /// Largest finite `f32` value.
  /// @value 3.40282347e+38
  max: func() -> f32;

  /// One greater than the minimum possible normal power of 2 exponent.
  /// @value -125
  min-exp: func() -> s32;

  /// Maximum possible power of 2 exponent.
  /// @value 128
  max-exp: func() -> s32;

  /// Minimum *x* for which 10<sup>*x*</sup> is normal.
  /// @value -37
  min-n10-exp: func() -> s32;

  /// Maximum *x* for which 10<sup>*x*</sup> is normal.
  /// @value 38
  max-n10-exp: func() -> s32;

  /// Not a Number (NaN).
  /// @value nan
  nan: func() -> f32;

  /// Infinity (∞).
  /// @value inf
  infinity: func() -> f32;

  /// Negative infinity (−∞).
  /// @value -inf
  neg-infinity: func() -> f32;
}