Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Tadpole operators
Search
taiseiue
May 24, 2024
Programming
0
61
Tadpole operators
taiseiue
May 24, 2024
Tweet
Share
More Decks by taiseiue
See All by taiseiue
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
280
Kotlinのデフォルト引数の話
taiseiue
0
68
.NETの上でお手製の言語を動かす技術
taiseiue
0
90
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
360
振り向き美人
taiseiue
0
24
(自作の)プログラミング言語ができるまで
taiseiue
1
520
Other Decks in Programming
See All in Programming
AIコーディングエージェント(skywork)
kondai24
0
160
生成AIを利用するだけでなく、投資できる組織へ
pospome
1
310
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
220
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
愛される翻訳の秘訣
kishikawakatsumi
1
320
JETLS.jl ─ A New Language Server for Julia
abap34
1
370
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
640
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
150
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
450
React Native New Architecture 移行実践報告
taminif
1
150
Go コードベースの構成と AI コンテキスト定義
andpad
0
120
Developing static sites with Ruby
okuramasafumi
0
270
Featured
See All Featured
Statistics for Hackers
jakevdp
799
230k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Thoughts on Productivity
jonyablonski
73
5k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Faster Mobile Websites
deanohume
310
31k
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 ビット 反転 移項 β α