xpower←{                ⍝ Fast multi-digit power using FFT.
    xt←{(0,⍺)xtimes 0,⍵}
    b←⌽2⊥⍣¯1+10⊥⍵       ⍝ boolean showing which powers needed
    ↑,/xt/b/{xt⍨⍵}\(⊂,10⊥⍣¯1+⍺)⍴⍨⍴b
}
code_colours

test script

Back to: notes

Back to: Workspaces