doc: format exponents better · nodejs/node@8ed4ab5 · GitHub
Skip to content

Commit 8ed4ab5

Browse files
tniessenaddaleax
authored andcommitted
doc: format exponents better
The `2^n` notation is common in mathematics, but even then it often requires parentheses or braces. In JavaScript and C++, the `^` operator stands for bitwise xor, and should be avoided in the docs. In code tags, the JavaScript operator `**` can be used. Otherwise, the `sup` tag can be used for formatting. PR-URL: #35050 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 921129c commit 8ed4ab5

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

doc/api/buffer.md

Lines changed: 2 additions & 2 deletions

doc/api/crypto.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2783,7 +2783,7 @@ added: REPLACEME
27832783
Return a random integer `n` such that `min <= n < max`. This
27842784
implementation avoids [modulo bias][].
27852785

2786-
The range (`max - min`) must be less than `2^48`. `min` and `max` must
2786+
The range (`max - min`) must be less than 2<sup>48</sup>. `min` and `max` must
27872787
be safe integers.
27882788

27892789
If the `callback` function is not provided, the random integer is

doc/api/n-api.md

Lines changed: 5 additions & 4 deletions

0 commit comments

Comments
 (0)