From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../objets_globaux/bigint/asuintn/index.html | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 files/fr/web/javascript/reference/objets_globaux/bigint/asuintn/index.html (limited to 'files/fr/web/javascript/reference/objets_globaux/bigint/asuintn') diff --git a/files/fr/web/javascript/reference/objets_globaux/bigint/asuintn/index.html b/files/fr/web/javascript/reference/objets_globaux/bigint/asuintn/index.html new file mode 100644 index 0000000000..742792d5e6 --- /dev/null +++ b/files/fr/web/javascript/reference/objets_globaux/bigint/asuintn/index.html @@ -0,0 +1,76 @@ +--- +title: BigInt.asUintN() +slug: Web/JavaScript/Reference/Objets_globaux/BigInt/asUintN +tags: + - BigInt + - Experimental + - JavaScript + - Méthode + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/BigInt/asUintN +--- +

{{JSRef}}

+ +

La méthode statique BigInt.asUintN() permet d'écréter un BigInt pour ramener sa valeur sur un entier non-signé entre 0 et 2largeur-1.

+ +
{{EmbedInteractiveExample("pages/js/bigint-asuintn.html")}}
+ + + +

Syntaxe

+ +
var résultat = BigInt.asUintN(largeur, bigint);
+ +

Paramètres

+ +
+
largeur
+
Le nombre de bits disponible pour stocker l'entier.
+
bigint
+
L'entier qu'on souhaite stocker sur le nombre de bits indiqués.
+
+ +

Valeur de retour

+ +

La valeur de bigint modulo 2largeur comme un entier non signé.

+ +

Exemples

+ +

La méthode BigInt.asUintN() peut s'avérer utile pour rester dans une arithmétique exprimée sur 64 bits .

+ +
const max = 2n ** 64n - 1n;
+
+BigInt.asUintN(64, max);
+// ↪ 18446744073709551615n
+
+BigInt.asUintN(64, max + 1n);
+// ↪ 0n
+// zéro en raison du dépassement
+ +

Spécifications

+ + + + + + + + + + + + +
SpécificationÉtat
Proposition pour BigIntProposition de niveau 3
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("javascript.builtins.BigInt.asUintN")}}

+ +

Voir aussi

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