From cb9e359a51c3249d8f5157db69d43fd413ddeda6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:45:12 +0100 Subject: unslug ca: move --- .../global_objects/math/fround/index.html | 118 +++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/math/fround/index.html (limited to 'files/ca/web/javascript/reference/global_objects/math/fround') diff --git a/files/ca/web/javascript/reference/global_objects/math/fround/index.html b/files/ca/web/javascript/reference/global_objects/math/fround/index.html new file mode 100644 index 0000000000..7411993dbc --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/math/fround/index.html @@ -0,0 +1,118 @@ +--- +title: Math.fround() +slug: Web/JavaScript/Referencia/Objectes_globals/Math/fround +translation_of: Web/JavaScript/Reference/Global_Objects/Math/fround +--- +
{{JSRef}}
+ +

La funció Math.fround() retorna la representació en coma flotant de precisió simple més propera d'un nombre.

+ +

Sintaxi

+ +
Math.fround(x)
+ +

Paràmetres

+ +
+
x
+
Un nombre.
+
+ +

Descripció

+ +

Com que fround() és un mètode estàtic de Math, sempre s'utilitza com Math.fround() en comptes de com un mètode d'un objecte Math creat (Math no és un constructor).

+ +

Exemples

+ +

Utilitzar Math.fround()

+ +
Math.fround(0);     // 0
+Math.fround(1);     // 1
+Math.fround(1.337); // 1.3370000123977661
+Math.fround(1.5);   // 1.5
+Math.fround(NaN);   // NaN
+
+ +

Polyfill

+ +

El comportament d'aquesta funció pot ser emulat amb la funció següent, si {{jsxref("Float32Array")}} està suportat:

+ +
Math.fround = Math.fround || function(x) {
+  return new Float32Array([x])[0];
+};
+
+ +

Especificacions

+ + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES6', '#sec-math.fround', 'Math.fround')}}{{Spec2('ES6')}}Definició inicial.
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatChrome("38")}}{{CompatGeckoDesktop("26")}}{{CompatNo}}{{CompatOpera("25")}}{{CompatSafari("7.1")}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatNo}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}8
+
+ +

Vegeu també

+ + -- cgit v1.2.3-54-g00ecf