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 urgency to change
anything, but users who wish to can now start switching to the new
`f32`/`f64` names.

[renamed to `f32` and `f64`]: WebAssembly#277
  • Loading branch information
sunfishcode committed Mar 18, 2024
1 parent 1bd7817 commit 68964e5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions design/mvp/Binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ primvaltype ::= 0x7f => bool
| 0x79 => u32
| 0x78 => s64
| 0x77 => u64
| 0x76 => float32
| 0x75 => float64
| 0x76 => f32
| 0x75 => f64
| 0x74 => char
| 0x73 => string
defvaltype ::= pvt:<primvaltype> => pvt
Expand Down
6 changes: 3 additions & 3 deletions design/mvp/Explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ deftype ::= <defvaltype>
| <instancetype>
defvaltype ::= bool
| s8 | u8 | s16 | u16 | s32 | u32 | s64 | u64
| float32 | float64
| f32 | f64
| char | string
| (record (field "<label>" <valtype>)+)
| (variant (case <id>? "<label>" <valtype>?)+)
Expand Down Expand Up @@ -583,7 +583,7 @@ sets of abstract values:
| `bool` | `true` and `false` |
| `s8`, `s16`, `s32`, `s64` | integers in the range [-2<sup>N-1</sup>, 2<sup>N-1</sup>-1] |
| `u8`, `u16`, `u32`, `u64` | integers in the range [0, 2<sup>N</sup>-1] |
| `float32`, `float64` | [IEEE754] floating-point numbers, with a single NaN value |
| `f32`, `f64` | [IEEE754] floating-point numbers, with a single NaN value |
| `char` | [Unicode Scalar Values] |
| `record` | heterogeneous [tuples] of named values |
| `variant` | heterogeneous [tagged unions] of named values |
Expand Down Expand Up @@ -1755,7 +1755,7 @@ At a high level, the additional coercions would be:
| `u8`, `u16`, `u32` | as a Number value | `ToUint8`, `ToUint16`, `ToUint32` |
| `s64` | as a BigInt value | `ToBigInt64` |
| `u64` | as a BigInt value | `ToBigUint64` |
| `float32`, `float64` | as a Number value | `ToNumber` |
| `f32`, `f64` | as a Number value | `ToNumber` |
| `char` | same as [`USVString`] | same as [`USVString`], throw if the USV length is not 1 |
| `record` | TBD: maybe a [JS Record]? | same as [`dictionary`] |
| `variant` | see below | see below |
Expand Down
6 changes: 3 additions & 3 deletions design/mvp/WIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ package local:demo;
interface foo {
a1: func();
a2: func(x: u32);
a3: func(y: u64, z: float32);
a3: func(y: u64, z: f32);
}
```

Expand All @@ -676,7 +676,7 @@ And functions can also return multiple types by naming them:
package local:demo;
interface foo {
a: func() -> (a: u32, b: float32);
a: func() -> (a: u32, b: f32);
}
```

Expand Down Expand Up @@ -1209,7 +1209,7 @@ Specifically the following types are available:
```ebnf
ty ::= 'u8' | 'u16' | 'u32' | 'u64'
| 's8' | 's16' | 's32' | 's64'
| 'float32' | 'float64'
| 'f32' | 'f64'
| 'char'
| 'bool'
| 'string'
Expand Down

0 comments on commit 68964e5

Please sign in to comment.