Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Numbers in javascript
Search
Taketoshi Aono(青野健利 a.k.a brn)
February 26, 2018
Programming
1
5.3k
Numbers in javascript
JSのNumberについて
Taketoshi Aono(青野健利 a.k.a brn)
February 26, 2018
Tweet
Share
More Decks by Taketoshi Aono(青野健利 a.k.a brn)
See All by Taketoshi Aono(青野健利 a.k.a brn)
document.write再考
brn
6
2.6k
Parsing Javascript
brn
12
7.2k
JSON & Object Tips
brn
1
300
CA 1Day Youth Bootcamp for Frontend LT
brn
0
680
Modern TypeScript
brn
2
680
javascript - behind the scene
brn
3
600
tc39 proposals
brn
0
650
プロダクト開発とTypeScript
brn
8
2.7k
React-Springでリッチなアニメーション
brn
1
500
Other Decks in Programming
See All in Programming
Elm Form Validation
bkuhlmann
0
510
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
260
Ruby Pattern Matching
bkuhlmann
0
920
Goのエラースタックトレースの歴史と今後
sonatard
7
1.1k
try! Swift Tokyo 2024のLT枠に採択されたプロポーザルを出すときに考えていたこと
ski
0
350
Milestoner
bkuhlmann
1
410
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
420
educure_カリキュラム生操作マニュアル.pdf
linew_official
0
710
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
26
8.2k
0→1と1→10の狭間で Javaという技術選定を振り返る/Reflecting on the Decision to Choose Java Between Scaling from 0 to 1 and 1 to 10
jaguar_imo
2
380
VS Code をプロダクトにどう取り込むか
onomax
1
350
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
890
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
23
3.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
17
1.4k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Adopting Sorbet at Scale
ufuk
68
8.6k
Clear Off the Table
cherdarchuk
84
310k
jQuery: Nuts, Bolts and Bling
dougneiner
59
7.1k
GitHub's CSS Performance
jonrohan
1025
450k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
2
3.4k
It's Worth the Effort
3n
180
27k
Unsuck your backbone
ammeep
663
57k
Web development in the modern age
philhawksworth
202
10k
Transcript
Numbers in javascript
Name @brn (ꫬꅿ⨳ⵃ) Occupation ؿٗٝزؒٝسؒٝآص،٥ط؎ذ؍ـؒٝآص، Company Cyberagent ،سذؙأةآؔ AI Messenger
OSS Contributor of V8 About http://info.b6n.ch
Number ES2016~2018穗גjavascriptך侧⦼㘗ח ְֻאַ㢌⻉ָ֮ךדך鑧
Variations - 侭侧 - 㼭侧 - 16鹌侧 - 8鹌侧 -
2鹌侧 - Bigint - Separator
侭侧 64bitתדך侭侧䪔ִ ⰻ鿇涸חכ㹋鄲⣛㶷ָ31bit侭侧ה64bit Doubleדⴽגְծ 64bit Doubleך
㼭侧 㼭侧挿 הֻח鎉ֲֿהזְָծⰻ鿇涸חכ64bit DoubleדⳢ椚ׁ זךד鎘皾穠卓כ鵚⡂⦼חז
16鹌侧 0xדכׄת侧⦼ CSSהַדֶזׄ
8鹌侧 0oדכׄתַ 0~ד7⟃♳ך侧⦼ָזְ㜥さח8鹌侧חז ؿ؋؎ٕػ٦ىحءّٝהַדֶזׄ
// 8進数! 0o777! ! // 暗黙の8進数 0777! ! // 0から始まる10進数
0778! ! "use strict";! 0777 // Error!!
2鹌侧 0bַ㨣ת0ה1ך⢪欽〳腉זٔذٕٓ
// 2進数! 0b11101101 // 237!
BigInt 64bit⟃♳ך侧⦼䪔ֲ㜥さח⢪ֲ 植㖈Stage3 侧⦼ٔذٕٓך䖓ח n אֽֿהדBigIntٔذٕٓ邌植ׅկ HexװOctalٔذٕٓ؟ه٦زկ侧⦼ٔذٕٓהずֻׄn劣㽵ח אֽֿהדBigIntחזկ(׃ծOctalכ0oXXX䕎䒭ך) תծtypeof <bigint>כ
'bigint'ָ䨱կ
// Bigint! 10n + 10n // 20n! 10n + 10
// Error! typeof 10n // 'bigint'! BigInt('100') // 100n!
BigInt 鑫׃ֻכ https://speakerdeck.com/brn/ecmascript-bigint ח剅ְ
Separator 植㖈Stage3 תmergeׁגְזְָV8ח㹋鄲׃ג ךֲ⢪ִ״ֲחזծ✮㹀
// Numeric Separators! 1_0_0_0_0! 0xFF_FF_FF! 0b1000_1111_0000! 0o7_7_7! ! 1__0 //
Error! 1000_ // Error!
׀幠耮ָ֮הֲ׀ְׂת׃