# number

a = 100; a = 10e5; a = 0100; a = 0x100; a = Number('100')

a = Number('100a') => NaN

**isNaN(a) //唯一判斷NaN 的方法**

就連 NaN == NaN or NaN === NaN 都會 false

parseInt(string, 10); //字串, 進制

使用 + 可以自動轉型

JS 比對整數

最大安全整數

Number.MAX\_SAFE\_INTEGER

以上就不能相信了

浮點數可以表現極大值，但有精準度問題

chrome 可以算 bigint

後面 + n

2n \*\* 1000000n // \*\* = ^

bigint 可以做計算，但是當除法有餘數時，會自動被省略

浮點數

0.1 + 0.2

(0.1 + 0.2).toFixed(1)

**+(0.1 + 0.2).toFixed(1)**

(0.000001).toString (0.0000001).toString


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://brianwu.gitbook.io/brian/qian-duan/qian-duan/he-xin-gai-nian/wu-jian-bian-shu-xing-bie/number.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
