Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Math.f16round and update status #5

Merged
merged 2 commits into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Authors: Kevin Gibbons

Champions: Leo Balter, Kevin Gibbons

This proposal is at Stage 1 of [The TC39 Process](https://tc39.es/process-document/). It will be presented to the committee for stage 2 or 3 at [the March meeting](https://github.com/tc39/agendas/blob/main/2023/03.md).
This proposal is at Stage 2 of [The TC39 Process](https://tc39.es/process-document/) as of the March 2023 meeting. Current it awaits confirmation from engines that it will be feasible to implement, at which point it will be presented for stage 3.

Spec text is available [here](https://tc39.es/proposal-float16array/).

Expand All @@ -26,7 +26,7 @@ Spec text is available [here](https://tc39.es/proposal-float16array/).

## Proposal

This would add a new kind of TypedArray, `Float16Array`, to complement the existing `Float32Array` and `Float64Array`. It would also add two new methods on `DataView` for reading and setting float16 values, as `getFloat16` and `setFloat16`, to complement the existing similar methods for working with full and double precision floats.
This would add a new kind of TypedArray, `Float16Array`, to complement the existing `Float32Array` and `Float64Array`. It would also add two new methods on `DataView` for reading and setting float16 values, as `getFloat16` and `setFloat16`, to complement the existing similar methods for working with full and double precision floats, as well as `Math.f16round`, to complement the existing `Math.fround`.

## Userland

Expand Down
19 changes: 18 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,23 @@ <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