zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 6f88ecc9b6ca4249912b7a9cffbad6d9b8819bc2 (tree)
parent 3e94347e6152dd9a88f4bceb46bbc245ed7cef98
Author: Andrew Kelley <superjoe30@gmail.com>
Date:   Wed, 27 Jun 2018 12:59:12 -0400

add f16 to langref

Diffstat:
Mdoc/langref.html.in | 15+++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

diff --git 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#}