Skip to content

Commit

Permalink
add Math.f16round
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot committed Mar 26, 2023
1 parent 29da88f commit 200b5bd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<pre class="metadata">
title: Float16Array
status: proposal
stage: 1
stage: 2
copyright: false
contributors: Kevin Gibbons
</pre>
Expand All @@ -28,6 +28,22 @@ <h1><ins>Float16Array ( . . . )</ins></h1>
</emu-clause>
</emu-clause>

<emu-clause id="sec-function-properties-of-the-math-object">
<h1>Function Properties of the Math Object</h1>
<emu-clause id="sec-math.f16round">
<h1><ins>Math.f16round ( _x_ )</ins></h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, return *NaN*.
1. If _n_ is one of *+0*<sub>𝔽</sub>, *-0*<sub>𝔽</sub>, *+∞*<sub>𝔽</sub>, or *-∞*<sub>𝔽</sub>, return _n_.
1. Let _n16_ be the result of converting _n_ to a value in IEEE 754-2019 binary16 format using roundTiesToEven mode.
1. Let _n64_ be the result of converting _n16_ to a value in IEEE 754-2019 binary64 format.
1. Return the ECMAScript Number value corresponding to _n64_.
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-typedarray-objects">
<h1>TypedArray Objects</h1>
<p>The table below is modified by the addition of a row for float16.</p>
Expand Down

0 comments on commit 200b5bd

Please sign in to comment.