Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
3/14なので円周率を計算する
Search
Masayuki Mizuno
April 04, 2024
530
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
3/14なので円周率を計算する
Masayuki Mizuno
April 04, 2024
More Decks by Masayuki Mizuno
See All by Masayuki Mizuno
OCaml Meeting 2026 in Tokyo
fetburner
0
330
CircleCI ユーザーミートアップ
fetburner
0
230
関数型まつり2026
fetburner
2
1.2k
Rails アプリの docker build を 倍速にした話
fetburner
2
200
Omotesando.rb #110
fetburner
0
260
Continuation is to be continued
fetburner
1
2.6k
callccの実装を読む
fetburner
0
270
RubyでSlackのbotを作ろう
fetburner
0
250
継続オペレータの話
fetburner
0
300
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
60k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
880
Google's AI Overviews - The New Search
badams
0
1.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.6k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
330
GitHub's CSS Performance
jonrohan
1033
470k
Raft: Consensus for Rubyists
vanstee
143
7.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Transcript
©2024 Wantedly, Inc. 3/14 ͳͷͰԁपΛܭࢉ͢Δ ͋Δ͍Rubyʹ͓͚Δҙਫ਼ܭࢉͱฒߦܭࢉΛࢼ͢ Omotesando.rb #96 Apr 4,
2024 - Masayuki Mizuno
©2024 Wantedly, Inc. ࠓ͢͜ͱ
©2024 Wantedly, Inc. ࠓ͢͜ͱ 3VCZʹΑΔԁपܭࢉϓϩάϥϜͷ࣮ ҙਫ਼ܭࢉϥΠϒϥϦͷൺֱ w *OUFHFS w #JH%FDJNBM
w (.1 ฒྻԽʹΑΔߴԽͷࢼΈ w 3BDUPS w ./εϨου
©2024 Wantedly, Inc. 3VCZʹΑΔԁपܭࢉϓϩάϥϜͷ࣮
©2024 Wantedly, Inc. ࣮ͷࠎࢠ͜Ε͚ͩ ࣮ͷৄࡉʹ͍ͭͯ͜Ε͔Βղઆ͠·͢ 3VCZʹΑΔԁपܭࢉϓϩάϥϜͷ࣮ https://gist.github.com/fetburner/4bb017fd6c4197894f97aac755749c45
©2024 Wantedly, Inc. $IVEOPWTLZͷެࣜ w ऩଋ͕ͱ͍ͯ w ԁपஹܻͷܭࢉʹΘΕͨ w #JOBSZTQMJUUJOH๏Ͱ࣌ؒܭࢉྔͱฒྻੑΛվળՄೳ
༻ͨ͠ެࣜ 1 π = 12 ∞ ∑ n=0 (−1)n(6n)! (3n)!(n!)3 545140134n + 13591409 6403203n+ 3 2
©2024 Wantedly, Inc. #JOBSZTQMJUUJOH๏ ڃܭࢉͷܭࢉྔͱฒྻੑΛվળ͢ΔςΫχοΫ w ԁप/ܻͷ࣌ؒܭࢉྔ͕ʹམͪΔ w ڞ௨͢ΔͷࢉΛݮͭͭ͠ɺ֤߲ͷܭࢉฒྻʹߦ͑Δ ׂ౷࣏๏ʹجͮ͘
w ࢉͷίετେ͖͍ํͷܻʹґଘ w ࣅͨΑ͏ͳܻಉ࢜Ͱܭࢉ͕ਐΉΑ͏εέδϡʔϧ O(N(log N)3)
©2024 Wantedly, Inc. ڞ௨͢ΔΛׅΓग़͢ ϗʔφʔ๏ͷཁྖ #JOBSZTQMJUUJOH๏ͷ࣮ྫ $IVEOPWTLZͷެࣜͷద༻ 6403203 12π
= ∞ ∑ k=0 (−1)n(6n)! (3n)!(n!)3 545140134n + 13591409 6403203n = 13591409 1 + (−1)6!(13591409 + 545140134) 3!(1!)36403203 + (−1)212!(13591409 + 2 ⋅ 545140134) 6!(2!)36403206 ⋯ = 13591409 + 1 ⋅ 1 ⋅ 5 1310939058860032000 ( (−1)(13591409 + 545140134) + 3 ⋅ 7 ⋅ 11 2310939058860032000 ((−1)2(13591409 + 2 ⋅ 545140134) + 5 ⋅ 13 ⋅ 17 3310939058860032000 (⋯)))
©2024 Wantedly, Inc. ༗ཧͰܭࢉΛਐΊΔͱߦྻੵʹؼணͰ͖Δ #JOBSZTQMJUUJOH๏ͷ࣮ྫ $IVEOPWTLZͷެࣜͷద༻ M N =
1 ⋅ 1 ⋅ 5 1310939058860032000 ((−1)(13591409 + 545140134) + 3 ⋅ 7 ⋅ 11 2310939058860032000 ((−1)2(13591409 + 2 ⋅ 545140134) + 5 ⋅ 13 ⋅ 17 3310939058860032000 (⋯))) π = 4270934400N 10005(M + 13591409N) ( M N) = ( 1 ⋅ 1 ⋅ 5 1 ⋅ 1 ⋅ 5 ⋅ (−1)(13591409 + 545140134) 0 1310939058860032000 ) ( 3 ⋅ 7 ⋅ 11 3 ⋅ 7 ⋅ 11 ⋅ (−1)2(13591409 + 2 ⋅ 545140134) 0 2310939058860032000 )⋯( 0 1) আࢉߴίετͳͷͰ࠷ޙʹ·ͱΊͯߦ͏
©2024 Wantedly, Inc. ಉܻ͡ಉ࢜Ͱܭࢉ͕ਐΉΑ͏ʹߦྻੵΛܭࢉ #JOBSZTQMJUUJOH๏ͷ࣮ྫ $IVEOPWTLZͷެࣜͷద༻ ҙਫ਼ࢉͷίετେ͖͍ํͷܻʹґଘ
©2024 Wantedly, Inc. ҙਫ਼ܭࢉϥΠϒϥϦͷൺֱ
©2024 Wantedly, Inc. 3VCZͷҙਫ਼ܭࢉϥΠϒϥϦҰཡ ΈࠐΈϥΠϒϥϦ CJHEFDJNBM HNQ *OUFHFS
(.1; ුಈখ #JH%FDJNBM (.1'
©2024 Wantedly, Inc. ΈࠐΈϥΠϒϥϦ *OUFHFSҙਫ਼ͷԋࢉ͕ߦ͑Δ w 3VCZҎલݻఆਫ਼ͷ'JYOVNͱҙਫ਼ͷ#JHOVNʹ͔Ε͍ͯͨ w 3VCZ͔Β*OUFHFSʹ౷Ұ͞Εͨ 'MPBUݻఆਫ਼ͷΈ
w ԁपͷߴਫ਼ܭࢉʹ֎෦ͷϥΠϒϥϦ͕ඞਢ
©2024 Wantedly, Inc. CJHEFDJNBM ҙਫ਼ͷුಈখϥΠϒϥϦ w ෦తʹਐͰදݱ͍ͯ͠Δ w
͕ͽͬͨΓʹͳΔ w ύϑΥʔϚϯε͋·Γྑ͘ͳ͍ σϑΥϧτHFN w 3VCZ࣌Ͱॲཧܥʹಉࠝ͞Ε͍ͯΔ w 3VCZ͔ΒCVOEMFEHFNʹͳΔΒ͍͠
©2024 Wantedly, Inc. HNQ (.1ٴͼ.1'3ͷ3VCZόΠϯσΟϯά w $Ͱ࣮͞Εͨஶ໊ͳϥΠϒϥϦ w ੑೳંΓࢴ͖ 3VCZόΠϯσΟϯάͷํ͋·Γϝϯς͞Εͯͳ͍
w 3VCZҎ߱ͰCVOEMFJOTUBMMͷڍಈ͕ո͍͠ w ة͏͘3VCZͰ͔͠ಈ͔ͳ͍ԁपܭࢉϓϩάϥϜ͕ੈʹग़Δॴͩͬͨ w 3BDUPSରԠͯ͠ͳ͍
©2024 Wantedly, Inc. ԁपܭࢉϓϩάϥϜͰ(.1Λ͏
©2024 Wantedly, Inc. ༻ͨ͠ϥΠϒϥϦຖͷԁपܭࢉͷൺֱ ສܻ ສܻ ສܻ ສܻ ԯܻ *OUFHFS
#JH%FDJNBM ඵ *OUFHFS (.1' ඵ ඵ ඵ ඵ (.1; (.1' ඵ ඵ ඵ ඵ ඵ
©2024 Wantedly, Inc. ༨ஊेҰੲ https://pc.watch.impress.co.jp/docs/news/yajiuma/636733.html
©2024 Wantedly, Inc. ฒྻԽʹΑΔߴԽͷࢼΈ
©2024 Wantedly, Inc. 3BDUPS 3VCZͰฒྻͳϓϩάϥϜΛهड़͢ΔͨΊͷػߏ w 3VCZ͔Βಋೖ͞Εͨ w "DUPSϞσϧʹجͮ͘ w
3BDUPSؒͰϝοηʔδͷૹड৴͕ߦΘΕΔ͜ͱͰܭࢉ͕ਐΉ ֦ுϥΠϒϥϦجຊNBJO3BDUPSͰ͔͠ಈ͔ͳ͍ w ޓੑͷͨΊ w ֦ுϥΠϒϥϦଆͰ3BDUPSʹରԠ͍ͯ͠ΔࣄΛද໌͢Δඞཁ͕͋Δ w HNQରԠͯ͠ͳ͍
©2024 Wantedly, Inc. ./εϨουεέδϡʔϥ .ݸͷ3VCZεϨουΛ/ݸͷωΠςΟϒεϨουͰ ࣮ߦ͢ΔϞσϧ w ඞཁҎ্ʹωΠςΟϒεϨουΛ࡞Βͳ͍͜ͱͰɺεϨουੜ͕ߴʹͳΔ 3VCZͷ৽ػೳ w
ैདྷݸͷ3VCZεϨουʹରͯ͠ݸͷωΠςΟϒεϨουΛׂΓ͍ͯͯͨ
©2024 Wantedly, Inc. ԁपܭࢉϓϩάϥϜͷฒྻԽ
©2024 Wantedly, Inc. ฒྻԽͷޮՌ ෳͷ$16ίΞΛ׆༻Ͱ͖͍ͯΔ
©2024 Wantedly, Inc. ฒྻԽલޙͰͷԁपܭࢉͷൺֱ ສܻ ສܻ ສܻ ສܻ ԯܻ 3BDUPSಋೖલ
ඵ ඵ ඵ ඵ ඵ 3BDUPSಋೖޙ ඵ ඵ ඵ ඵ ඵ
©2024 Wantedly, Inc. ฒྻԽͰ٫ͬͯ͘ͳͬͨ🤔 3BDUPSͷಋೖ݁Ռ
©2024 Wantedly, Inc. ($͕ϘτϧωοΫʹͳ͍ͬͯΔ ($தશͯͷ3BDUPSͷ࣮ߦ͕ఀࢭͯ͠͠·͏ ฒྻԽͰ͘ͳͬͨݪҼͷߟ
©2024 Wantedly, Inc. ·ͱΊ
©2024 Wantedly, Inc. ·ͱΊ 3VCZʹΑΔԁपܭࢉϓϩάϥϜΛ࣮ ҙਫ਼ܭࢉϥΠϒϥϦຖʹੑೳΛൺֱ w ಛผͳࣄ͕ແ͚ΕHNQΛ͏ͱ͍ 3BDUPSͰฒྻ࣮ߦΛߦ͕ͬͨɺੑೳ৳ͼͳ͔ͬͨ w
ฒྻ࣮ߦͰ͖ͳ͍($͕ϘτϧωοΫʹͳ͍ͬͯΔ w ࠷దԽΛߦ͏લʹTUBDLQSPGͰϘτϧωοΫΛ֬ೝ͠·͠ΐ͏ w ֦ுϥΠϒϥϦ͕3BDUPSʹରԠ͍ͯ͠ͳ͍߹͋ΔͷͰؾΛ͚͍ͨ