타이프 라이터 bigint 대 번호

코드 예제

0
0

타이프 라이터 bigint 대 번호

1. BigInt is an integer, number is a decimal
  //bigInt
  var BigNum1=100n;     	//ok
  var BigNum2=100.20n;    //error
  //number
  var Num1=100;           //ok
  var Num2=100.20;        //ok

2. Different implementation
The number can handle numbers up to 9007199254740991.
The BigInt can handle arbitrary long numbers, limited by the available memory of the system.

3. BigInt cannot be used in arithmetic operations with numbers
  let numVar=100;
  let bigVar= 100n;
  console.log(numVar+bigVar); // error

4. ...but you can compare them
  console.log(1n < 2)     //true
  console.log(2n > 1)     //true
  console.log(2n > 2)     //false
  console.log(2n >= 2)    //true

5. More details on the source

비슷한 페이지

예제가있는 유사한 페이지

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................