Pro Yearly is on sale from $80 to $50! »

Numbers in javascript

Numbers in javascript

JSのNumberについて

Transcript

  1. Numbers in javascript

  2. Name @brn (ꫬꅿ⨳ⵃ) Occupation ؿٗٝزؒٝسؒٝآص،٥ط؎ذ؍ـؒٝآص، Company Cyberagent ،سذؙأةآؔ AI Messenger

    OSS Contributor of V8 About http://info.b6n.ch
  3. Number ES2016~2018׾穗גjavascriptך侧⦼㘗ח׮ ְֻאַ㢌⻉ָ֮׏׋ךד׉ך鑧

  4. Variations -  侭侧 -  㼭侧 -  16鹌侧 -  8鹌侧 - 

    2鹌侧 -  Bigint -  Separator
  5. 侭侧 64bitתדך侭侧׾䪔ִ׷ ⰻ鿇涸חכ㹋鄲⣛㶷׌ָ31bit侭侧ה64bit Doubleדⴽ׸גְ׋׶ծ 64bit Doubleך׫׌׏׋׶

  6. 㼭侧 㼭侧挿 הֻח鎉ֲֿה׮זְָծⰻ鿇涸חכ64bit DoubleדⳢ椚ׁ׸׷ זךד鎘皾穠卓כ鵚⡂⦼חז׷

  7. 16鹌侧 0xדכׄת׷侧⦼ CSSהַדֶזׄ׫

  8. 8鹌侧 0oדכׄת׷ַ 0~ד7⟃♳ך侧⦼ָזְ㜥さח8鹌侧חז׷ ؿ؋؎ٕػ٦ىحءّٝהַדֶזׄ׫

  9. // 8進数! 0o777! ! // 暗黙の8進数 0777! ! // 0から始まる10進数

    0778! ! "use strict";! 0777 // Error!!
  10. 2鹌侧 0bַ׵㨣ת׷0ה1ך׫⢪欽〳腉זٔذٕٓ

  11. // 2進数! 0b11101101 // 237!

  12. BigInt 64bit⟃♳ך侧⦼׾䪔ֲ㜥さח⢪ֲ 植㖈Stage3 侧⦼ٔذٕٓך䖓׹ח n ׾אֽ׷ֿהדBigIntٔذٕٓ׾邌植ׅ׷կ HexװOctalٔذٕٓ׮؟ه٦زկ侧⦼ٔذٕٓהずֻׄn׾劣㽵ח אֽ׷ֿהדBigIntחז׷կ(׋׌׃ծOctalכ0oXXX䕎䒭ך׫) ת׋ծtypeof <bigint>כ

    'bigint'ָ䨱׷կ
  13. // Bigint! 10n + 10n // 20n! 10n + 10

    // Error! typeof 10n // 'bigint'! BigInt('100') // 100n!
  14. BigInt 鑫׃ֻכ https://speakerdeck.com/brn/ecmascript-bigint ח剅ְ׋

  15. Separator 植㖈Stage3 ת׌mergeׁ׸גְזְָV8ח㹋鄲׃ג׫׋ ׉ךֲ׍⢪ִ׷״ֲחז׷ծ✮㹀

  16. // Numeric Separators! 1_0_0_0_0! 0xFF_FF_FF! 0b1000_1111_0000! 0o7_7_7! ! 1__0 //

    Error! 1000_ // Error!
  17. ׀幠耮֮׶ָהֲ׀ְׂת׃׋