Skip to content

Commit 0026e91

Browse files
authored
Merge pull request #1623 from kakts/feature/divide
fix: 0除算の結果がエラーにならず、Infinityになることの説明追記(#1616)
2 parents 3fa76c2 + cab6d3e commit 0026e91

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/basic/operator/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ console.log(8 / 2); // => 4
113113
console.log(10 / 0.5); // => 20
114114
```
115115

116+
ただし、任意の数値を`0`で除算した結果は、無限大を表す数値である`Infinity`となります。
117+
118+
{{book.console}}
119+
```js
120+
console.log(10 / 0); // => Infinity
121+
```
122+
116123
### 剰余演算子(`%`) {#modulus-operator}
117124

118125
2つの数値を除算したあまりを求める演算子です。左オペランドを右オペランドで除算したあまりを返します。

0 commit comments

Comments
 (0)