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
Tadpole operators
Search
taiseiue
May 24, 2024
Programming
0
65
Tadpole operators
taiseiue
May 24, 2024
Tweet
Share
More Decks by taiseiue
See All by taiseiue
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
310
Kotlinのデフォルト引数の話
taiseiue
0
79
.NETの上でお手製の言語を動かす技術
taiseiue
0
97
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
390
振り向き美人
taiseiue
0
25
(自作の)プログラミング言語ができるまで
taiseiue
1
560
Other Decks in Programming
See All in Programming
CSC307 Lecture 09
javiergs
PRO
1
830
AIエージェントの設計で注意するべきポイント6選
har1101
7
3.4k
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
290
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
180
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
140
Vibe codingでおすすめの言語と開発手法
uyuki234
0
220
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
440
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.8k
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
890
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
480
dchart: charts from deck markup
ajstarks
3
990
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
64
A designer walks into a library…
pauljervisheath
210
24k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Building the Perfect Custom Keyboard
takai
2
680
The Invisible Side of Design
smashingmag
302
51k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Done Done
chrislema
186
16k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
RailsConf 2023
tenderlove
30
1.3k
We Are The Robots
honzajavorek
0
160
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.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 ビット 反転 移項 β α