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
89
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
同人サークルを作って 8年経った僕らの現在地
taiseiue
0
180
RustでもVJしたい!
taiseiue
0
92
“⾞が通れるほど⼤きな”セキュリティーホールを抑えながらログインしたい
taiseiue
0
480
Kotlinのデフォルト引数の話
taiseiue
0
110
.NETの上でお手製の言語を動かす技術
taiseiue
0
120
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
480
振り向き美人
taiseiue
0
40
(自作の)プログラミング言語ができるまで
taiseiue
1
680
Other Decks in Programming
See All in Programming
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
570
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
2
300
JRuby: Past, Present, and Future
headius
0
190
setup-vp GitLab対応の裏側
naokihaba
0
120
Jetpack Compose メカニズム
skydoves
0
470
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
330
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
360
SREの越境 / SRE Collaboration
y0hgi
2
280
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
130
スマート反転とウェブアクセシビリティ
camiha
0
210
Intent as Code
shoppingjaws
6
1.1k
Heart of Swift Concurrency
koher
0
960
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
500
Color Theory Basics | Prateek | Gurzu
gurzu
1
470
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
340
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
500
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Mind Mapping
helmedeiros
1
370
The Cost Of JavaScript in 2023
addyosmani
55
10k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
510
Skip the Path - Find Your Career Trail
mkilby
1
240
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
530
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 ビット 反転 移項 β α