JavaScript Math.f16round()
Example
let a = Math.f16round(2.60);
let b = Math.f16round(2.50);
let c = Math.f16round(2.49);
let d = Math.f16round(-2.60);
let e = Math.f16round(-2.50);
let f = Math.f16round(-2.49);
Try it Yourself »
Description
The Math.f16round()
method returns the
nearest 16-bit single precision floating point representation of a number.
JavaScript Rounding Functions
The Math.abs() MethodThe Math.ceil() Method
The Math.floor() Method
The Math.round() Method
The Math.fround() Method
The Math.f16round() Method
The Math.trunc() Method
Syntax
Math.f16round(x)
Parameters
Parameter | Description |
x | Required. A number. |
Return Value
Type | Description |
Number | The nearest 16-bit single precision floating point representation of the number. |
Browser Support
Math.f16round()
is an ES2025 feature.
ES2025 is fully supported in all modern browsers since May 2025:
Chrome 135 | Edge 135 | Firefox 129 | Safari 18.2 | Opera 120 |
Apr 2025 | Apr 2025 | Aug 2024 | Des 2024 | May 2025 |