File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Top Open diff view settings Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Top Open diff view settings Original file line number Diff line number Diff line change @@ -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#}
You can’t perform that action at this time.
0 commit comments