authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-06-27 12:59:12-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-06-27 12:59:12-04:00
log6f88ecc9b6ca4249912b7a9cffbad6d9b8819bc2
treeaf1fe04e70c7b8950ee64b51ea0467735e1645e9
parent3e94347e6152dd9a88f4bceb46bbc245ed7cef98

add f16 to langref


1 files changed, 11 insertions(+), 4 deletions(-)

doc/langref.html.in+11-4
......@@ -367,6 +367,11 @@ pub fn main() void {
367367 <td>for ABI compatibility with C</td>
368368 </tr>
369369
370 <tr>
371 <td><code>f16</code></td>
372 <td><code>float</code></td>
373 <td>16-bit floating point (10-bit mantissa) IEEE-754-2008 binary16</td>
374 </tr>
370375 <tr>
371376 <td><code>f32</code></td>
372377 <td><code>float</code></td>
......@@ -654,6 +659,7 @@ fn divide(a: i32, b: i32) i32 {
654659 {#header_open|Floats#}
655660 <p>Zig has the following floating point types:</p>
656661 <ul>
662 <li><code>f16</code> - IEEE-754-2008 binary16</li>
657663 <li><code>f32</code> - IEEE-754-2008 binary32</li>
658664 <li><code>f64</code> - IEEE-754-2008 binary64</li>
659665 <li><code>f128</code> - IEEE-754-2008 binary128</li>
......@@ -3671,10 +3677,11 @@ test "implicit unsigned integer to signed integer" {
36713677}
36723678
36733679test "float widening" {
3674 var a: f32 = 12.34;
3675 var b: f64 = a;
3676 var c: f128 = b;
3677 assert(c == a);
3680 var a: f16 = 12.34;
3681 var b: f32 = a;
3682 var c: f64 = b;
3683 var d: f128 = c;
3684 assert(d == a);
36783685}
36793686 {#code_end#}
36803687 {#header_close#}