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
92
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Tadpole operators
taiseiue
May 24, 2024
More Decks by taiseiue
See All by taiseiue
自サークルのIdPからログアウトできるようになるまで
taiseiue
0
14
同人サークルを作って 8年経った僕らの現在地
taiseiue
0
200
RustでもVJしたい!
taiseiue
0
100
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
540
Kotlinのデフォルト引数の話
taiseiue
0
120
.NETの上でお手製の言語を動かす技術
taiseiue
0
120
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
490
振り向き美人
taiseiue
0
41
(自作の)プログラミング言語ができるまで
taiseiue
1
690
Other Decks in Programming
See All in Programming
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
390
The Rails Doctrine Decade
koic
2
460
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
290
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
470
AWSに止められる覚悟してますか?
morizo_1984
2
500
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
330
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
330
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
300
カツオ、ご期待ください
suneo3476
0
140
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2.1k
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
290
Agents on Rails - Rails at Scale 2026
irinanazarova
0
310
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
310
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
330
Agile that works and the tools we love
rasmusluckow
331
22k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Designing Experiences People Love
moore
143
24k
Facilitating Awesome Meetings
lara
57
7.2k
How to train your dragon (web standard)
notwaldorf
97
6.8k
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
Product Roadmaps are Hard
iamctodd
55
13k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
730
Discover your Explorer Soul
emna__ayadi
2
1.3k
Balancing Empowerment & Direction
lara
6
1.3k
Transcript
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 ビット 反転 移項 β α