Skip to content

Commit

Permalink
Rename float32/float64 to f32/f64.
Browse files Browse the repository at this point in the history
The `float32` and `float64` types are being
[renamed to `f32` and `f64`]. All the main tools have been updated to
accept both old and new names for now, so there's no urgeny to change
anything, but users who wish to can now start switching to the new
`f32`/`f64` names.

While here, also add some brief documentation mentioning the handling
of NaNs in `f32`/`f64`.

[renamed to `f32` and `f64`]: WebAssembly/component-model#277
  • Loading branch information
sunfishcode committed Mar 18, 2024
1 parent 83f3f4c commit 0790618
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion component-model/src/design/wit.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ WIT defines the following primitive types:
| `bool` | Boolean value - true or false. |
| `s8`, `s16`, `s32`, `s64` | Signed integers of the appropriate width. For example, `s32` is a 32-bit integer. |
| `u8`, `u16`, `u32`, `u64` | Unsigned integers of the appropriate width. For example, `u32` is a 32-bit integer. |
| `float32`, `float64` | Floating-point numbers of the appropriate width. For example, `float64` is a 64-bit (double precision) floating-point number. |
| `f32`, `f64` | Floating-point numbers of the appropriate width. For example, `f64` is a 64-bit (double precision) floating-point number. See the note on NaNs below. |
| `char` | Unicode character. (Specifically, a [Unicode scalar value](https://unicode.org/glossary/#unicode_scalar_value).) |
| `string` | A Unicode string - that is, a finite sequence of characters. |

The `f32` and `f64` types support the usual set of IEEE 754 single and double-precision values, except that they logically only have a single NaN value. NaN payloads are not guaranteed to be preserved when values pass through WIT interfaces.

### Lists

`list<T>` for any type T denotes an ordered sequence of values of type T. T can be any type, built-in or user-defined:
Expand Down

0 comments on commit 0790618

Please sign in to comment.