Skip to content

Commit 9ca5782

Browse files
docs: qualify large-integer true division [pr30-codex-addressed]
1 parent 150a301 commit 9ca5782

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

strings-and-numbers/03-int-float-and-bool/README.es.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ print(type(7 / 2))
171171
<class 'float'>
172172
```
173173

174-
Incluso cuando ambos operandos son enteros, `/` produce un resultado de punto flotante.
174+
Incluso cuando ambos operandos son enteros, `/` normalmente produce un resultado de punto flotante cuando el cociente puede representarse como `float`. Si el cociente entero es demasiado grande para representarse como `float`, la división verdadera genera `OverflowError`.
175175

176176
```python
177177
print(8 / 4)
@@ -183,7 +183,7 @@ print(type(8 / 4))
183183
<class 'float'>
184184
```
185185

186-
Si el cociente matemático es entero, el resultado sigue siendo un `float` cuando se usa `/`.
186+
Cuando el cociente puede representarse como `float`, un cociente matemáticamente entero sigue teniendo tipo `float` cuando se usa `/`.
187187

188188
## 8. `//` es división por piso
189189

strings-and-numbers/03-int-float-and-bool/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ print(type(7 / 2))
171171
<class 'float'>
172172
```
173173

174-
Even when both operands are integers, `/` produces a floating-point result.
174+
Even when both operands are integers, `/` normally produces a floating-point result when the quotient is representable as a `float`. If the integer quotient is too large to be represented as a `float`, true division raises `OverflowError` instead.
175175

176176
```python
177177
print(8 / 4)
@@ -183,7 +183,7 @@ print(type(8 / 4))
183183
<class 'float'>
184184
```
185185

186-
If the mathematical quotient is whole, the result is still a `float` when `/` is used.
186+
When the quotient is representable as a `float`, a mathematically whole quotient still has type `float` when `/` is used.
187187

188188
## 8. `//` is floor division
189189

strings-and-numbers/03-int-float-and-bool/README.pt-BR.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ print(type(7 / 2))
171171
<class 'float'>
172172
```
173173

174-
Mesmo quando os dois operandos são inteiros, `/` produz um resultado de ponto flutuante.
174+
Mesmo quando os dois operandos são inteiros, `/` normalmente produz um resultado de ponto flutuante quando o quociente pode ser representado como `float`. Se o quociente inteiro for grande demais para ser representado como `float`, a divisão verdadeira gera `OverflowError`.
175175

176176
```python
177177
print(8 / 4)
@@ -183,7 +183,7 @@ print(type(8 / 4))
183183
<class 'float'>
184184
```
185185

186-
Se o quociente matemático for inteiro, o resultado ainda será um `float` quando `/` for utilizado.
186+
Quando o quociente pode ser representado como `float`, um quociente matematicamente inteiro ainda tem tipo `float` quando `/` é utilizado.
187187

188188
## 8. `//` é divisão pelo piso
189189

0 commit comments

Comments
 (0)