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
Tadpole operators
Search
taiseiue
May 24, 2024
Programming
98
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Tadpole operators
taiseiue
May 24, 2024
Transcript
5 slides
Tadpole operators ⾮変インクリメント/デクリメント
Tadpole Operators†とは? • 副作⽤を起こさないインクリメント/デクリメントのこと • ⽇本語では⾮変インクリメント / ⾮変デクリメント • ⾒た⽬からtadpole(おたまじゃくし)演算⼦とも
値が書きかわらない 演算⼦ 同じ意味の式 意味 -~x X + 1 Xに向かって値が⼊って いくイメージ ~-x X - 1 Xから値が出ていく イメージ †https://devblogs.microsoft.com/oldnewthing/20150525-00/?p=45044
Tadpole Operators:利点 • 単項演算⼦なので優先順位が⾼い • (x + 1) * (x
- 1) なら -~x * ~-x と書ける • インクリメント/デクリメントと違い副作⽤がない
ネタバラシ シンキングタイムいる?
ネタバラシ • 本当は`~`(ビット反転)と`-`(符号反転)の組み合わせ • かっこで整理すると ‒(~x)、~(-x)に -(~x) == x+1 ~x
+ 1 == -x を常に満たす x + ~x + 1 == 0 X=5 0101 0011 Y=~X +1010 1100 Z=X+Y 1111 1111 α=Z+1 + 1 β 1 0000 0000 ビット 反転 移項 β α
More Decks by taiseiue
See All by taiseiue
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
170
同人サークルを作って 8年経った僕らの現在地
taiseiue
0
310
RustでもVJしたい!
taiseiue
0
120
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
650
Kotlinのデフォルト引数の話
taiseiue
0
130
.NETの上でお手製の言語を動かす技術
taiseiue
0
130
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
510
振り向き美人
taiseiue
0
50
(自作の)プログラミング言語ができるまで
taiseiue
1
710
Other Decks in Programming
See All in Programming
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
130
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
200
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
370
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
2.3k
SODA - FACT BOOK(JP)
sodainc
1
40k
RaspberryPi 5で軽くはじめるk3sとtailscaleを用いたホームサーバー構築 (1)
nasum
0
340
オーケストレーション記述言語 Katari
yukikurage
0
260
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
Crash Auto Pipelines
veronikapj
1
420
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
350
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
5.9k
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
150
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Documentation Writing (for coders)
carmenintech
77
5.6k
What's in a price? How to price your products and services
michaelherold
247
13k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
640
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Deep Space Network (abreviated)
tonyrice
0
420
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
300
Evolving SEO for Evolving Search Engines
ryanjones
0
360