Skip to content

Numbers - #478

Open
diogoosz wants to merge 3 commits into
javascript-tutorial:masterfrom
diogoosz:translate-numbers
Open

diogoosz wants to merge 3 commits into
javascript-tutorial:masterfrom
diogoosz:translate-numbers

Conversation

@diogoosz

@diogoosz diogoosz commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Tradução do artigo "Numbers" para o português, incluindo os exercícios.

Conforme comentado na #1.

diogoosz and others added 3 commits November 8, 2026 19:41
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
These belong on a separate branch (translate-arrays), not here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
let billion = 1e9; // 1 bilhão, literalmente: 1 e 9 zeros

alert( 7.3e9 ); // 7.3 billions (same as 7300000000 or 7_300_000_000)
alert( 7.3e9 ); // 7,3 bilhões (o mesmo que 7300000000 ou 7_300_000_000)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separador decimal misturado: o comentário diz 7,3 bilhões logo ao lado do código 7.3e9 (e a linha 27 usa "7,3bi"), enquanto o resto do artigo usa ponto (12.34, 0.1). Um iniciante pode achar que 7,3 é um literal válido em JS (na verdade, é o operador vírgula e resulta em 3). Sugiro manter 7.3 como no original.

1. Multiplicar e dividir.

For example, to round the number to the 2nd digit after the decimal, we can multiply the number by `100`, call the rounding function and then divide it back.
Por exemplo, para arredondar o número até o 2º dígito depois da vírgula, podemos multiplicar o número por `100`, chamar a função de arredondamento e depois dividir de volta.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminologia inconsistente: aqui (e nas linhas 157 e 172) está "depois da vírgula", mas as linhas 68, 143, 197 e 263 usam "ponto decimal". Como os exemplos são 1.2345/1.23456, onde o separador é um ponto, "vírgula" confunde. Sugiro padronizar com "ponto decimal".

Agora vamos escrever algo bem pequeno. Digamos, 1 microssegundo (um milionésimo de segundo):

```js
let mсs = 0.000001;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pré-existente no original, mas está dentro do hunk: mсs usa o с cirílico (U+0441), e a linha 53 usa mcs latino. Quem copiar os dois trechos fica com dois identificadores diferentes. Sugiro trocar pelo c latino.


```js
let mcs = 1e-6; // five zeroes to the left from 1
let mcs = 1e-6; // cinco zeros à esquerda do 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O comentário "cinco zeros à esquerda do 1" contradiz a linha 55 ("há 6 deles"), e 0.000001 tem seis zeros. Já estava assim no original, mas dá para corrigir na tradução: "seis zeros à esquerda do 1".

```js run
alert( 0xff ); // 255
alert( 0xFF ); // 255 (the same, case doesn't matter)
alert( 0xFF ); // 255 (o mesmo, a caixa não importa)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"a caixa não importa" é jargão tipográfico e fica obscuro para iniciantes. Sugiro: "o mesmo, maiúsculas ou minúsculas não importam".

```

Note the unary plus `+` before `prompt`. It immediately converts the value to a number.
Observe o mais unário `+` antes de `prompt`. Ele converte o valor para um número imediatamente.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"mais unário" (aqui e nas linhas 193 e 388 do article.md) não bate com o termo do capítulo de operadores (1-js/02-first-steps/08-operators/article.md:128,132: "+ unário" / "positivo unário"). Vale padronizar para que o leitor reconheça o mesmo conceito.

describe("readNumber", function() {

it("if a number, returns it", function() {
it("se for um número, retorna ele", function() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"retorna ele" (aqui e na linha 16) usa o pronome reto como objeto, o que é coloquial e foge da norma. Sugiro "retorna o número" / "retorna 0" (ou "retorna-o").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants