Skip to content

Commit

Permalink
Merge pull request #401 from nd-02110114/add-permanent-notation-math
Browse files Browse the repository at this point in the history
add-permanent-notation to math
  • Loading branch information
azu authored Mar 16, 2018
2 parents 4d03f3e + 53d3195 commit dbaa043
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/basic/math/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
author: laco
---

# Math
# Math {#math}

この章では、JavaScriptで数学的な定数と関数を提供する組み込みのオブジェクトである[Math][]について学びます。

## Mathオブジェクト
## Mathオブジェクト {#math-object}

`Math`オブジェクトはビルトインのグローバルオブジェクトですが、コンストラクタではありません。
つまり`Math`オブジェクトはインスタンスを作らず、
Expand All @@ -25,7 +25,7 @@ console.log(sin90); // => 1
この章ではそれらのうちよく使われるものについてユースケースを交えて紹介します。
網羅的な解説については[MDNのリファレンス][]を参照してください。

### 乱数を生成する
### 乱数を生成する {#create-random-number}

`Math`オブジェクトの主な用途のひとつは、[Math.random][]メソッドによる乱数の生成です。
`Math.random`メソッドは、0以上1未満の範囲内で、疑似ランダムな浮動小数点数を返します。
Expand All @@ -51,7 +51,7 @@ function getRandom(min, max) {
console.log(getRandom(1, 5));
```

### 数値の大小を比較する
### 数値の大小を比較する {#compare-number}

[Math.max][]メソッドは引数として渡された複数の数値のうち、最大のものを返します。
同様に、[Math.min][]メソッドは引数として渡された複数の数値のうち、最小のものを返します。
Expand Down

0 comments on commit dbaa043

Please sign in to comment.