diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-06-27 12:59:12 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-06-27 12:59:12 -0400 |
| commit | 6f88ecc9b6ca4249912b7a9cffbad6d9b8819bc2 (patch) | |
| tree | af1fe04e70c7b8950ee64b51ea0467735e1645e9 /doc | |
| parent | 3e94347e6152dd9a88f4bceb46bbc245ed7cef98 (diff) | |
| download | zig-6f88ecc9b6ca4249912b7a9cffbad6d9b8819bc2.tar.gz zig-6f88ecc9b6ca4249912b7a9cffbad6d9b8819bc2.zip | |
add f16 to langref
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/langref.html.in | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in index 8e24a4be2c..dbb4ea9806 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -368,6 +368,11 @@ pub fn main() void { </tr> <tr> + <td><code>f16</code></td> + <td><code>float</code></td> + <td>16-bit floating point (10-bit mantissa) IEEE-754-2008 binary16</td> + </tr> + <tr> <td><code>f32</code></td> <td><code>float</code></td> <td>32-bit floating point (23-bit mantissa) IEEE-754-2008 binary32</td> @@ -654,6 +659,7 @@ fn divide(a: i32, b: i32) i32 { {#header_open|Floats#} <p>Zig has the following floating point types:</p> <ul> + <li><code>f16</code> - IEEE-754-2008 binary16</li> <li><code>f32</code> - IEEE-754-2008 binary32</li> <li><code>f64</code> - IEEE-754-2008 binary64</li> <li><code>f128</code> - IEEE-754-2008 binary128</li> @@ -3671,10 +3677,11 @@ test "implicit unsigned integer to signed integer" { } test "float widening" { - var a: f32 = 12.34; - var b: f64 = a; - var c: f128 = b; - assert(c == a); + var a: f16 = 12.34; + var b: f32 = a; + var c: f64 = b; + var d: f128 = c; + assert(d == a); } {#code_end#} {#header_close#} |
