From bf8e099b9c8b3c60d60b3712b4fc97b052c39887 Mon Sep 17 00:00:00 2001 From: julieng Date: Tue, 3 Aug 2021 08:03:23 +0200 Subject: convert content to md --- .../global_objects/bigint/asuintn/index.md | 65 +++++++++------------- 1 file changed, 27 insertions(+), 38 deletions(-) (limited to 'files/fr/web/javascript/reference/global_objects/bigint/asuintn') diff --git a/files/fr/web/javascript/reference/global_objects/bigint/asuintn/index.md b/files/fr/web/javascript/reference/global_objects/bigint/asuintn/index.md index 5331dbae11..096fc6af73 100644 --- a/files/fr/web/javascript/reference/global_objects/bigint/asuintn/index.md +++ b/files/fr/web/javascript/reference/global_objects/bigint/asuintn/index.md @@ -10,64 +10,53 @@ tags: translation_of: Web/JavaScript/Reference/Global_Objects/BigInt/asUintN original_slug: Web/JavaScript/Reference/Objets_globaux/BigInt/asUintN --- -

{{JSRef}}

+{{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 2^(largeur)-1.

+La méthode statique **`BigInt.asUintN()`** permet d'écréter un `BigInt` pour ramener sa valeur sur un entier non-signé entre 0 et 2^(largeur)-1. -
{{EmbedInteractiveExample("pages/js/bigint-asuintn.html")}}
+{{EmbedInteractiveExample("pages/js/bigint-asuintn.html")}} -

Syntaxe

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

Paramètres

+### 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.
-
+- `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

+### Valeur de retour -

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

+La valeur de `bigint` modulo 2^`largeur` comme un entier non signé. -

Exemples

+## Exemples -

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

+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;
+```js
+const max = 2n ** 64n - 1n;
 
 BigInt.asUintN(64, max);
 // ↪ 18446744073709551615n
 
 BigInt.asUintN(64, max + 1n);
 // ↪ 0n
-// zéro en raison du dépassement
+// zéro en raison du dépassement +``` -

Spécifications

+## Spécifications - - - - - - - - - - - -
SpécificationÉtat
Proposition pour BigIntProposition de niveau 3
+| Spécification | État | +| ------------------------------------------------------------------------------------- | ----------------------- | +| [Proposition pour BigInt](https://tc39.github.io/proposal-bigint/#sec-bigint.asuintn) | Proposition de niveau 3 | -

Compatibilité des navigateurs

+## Compatibilité des navigateurs -

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

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

Voir aussi

+## Voir aussi - +- {{JSxRef("BigInt")}} +- {{JSxRef("BigInt.asIntN()")}} -- cgit v1.2.3-54-g00ecf