4 ms·
> I'm especially fond of the power (⍣) operator Oh boy, I had a mind-melting moment with _inverse_ (⍣¯1). Aaron helped me understand what was going on. He wro
by adityaathalye 5y ago
> I'm especially fond of the power (⍣) operator
Oh boy, I had a mind-melting moment with _inverse_ (⍣¯1).
Aaron helped me understand what was going on. He wrote about "Decoding Inverses" here: https://www.sacrideo.us/decoding-inverses/ https://www.sacrideo.us/decoding-inverses/
And that took me from a clunky solution to Dismal Arithmetic (addition):
{10(⊤⍣¯1)⍵}∘{⌈/⍵}∘{10(⊥⍣¯1)⍵}⊢ 100000 10000 1000 100 10 1
111111
To this little gem:
da ← 10⊥(⌈/10⊥⍣¯1⊢)
da 169 248
269
(Edit: add code example, fix language)
- nyc111 5y agoThanks for the reference to Dismal Arithmetic, I found it very interesting. By the way, according to Wikipedia, Dismal Arithmetic is now called Lunar Arithmetic. https://en.m.wikipedia.org/wiki/Lunar_arithmetic https://en.m.wikipedia.org/wiki/Lunar_arithmetic