fFc=: (32&+)@(*&1.8) ]b=:fFc _40 0 100 _40 32 212 cFf=: fFc^:_1 cFf b _40 0 100片語 f &. g 的結果為動詞 (g^:_1)@(f & g)。函數 g 可視為為了"主" 函數 f 的應用做準備 (之前執行,之後反向執行) 。例如:
b=: 0 0 1 0 1 0 1 1 0 0 0 sup=: </\ 刪除除了首項外之所有 1 sup b 0 0 1 0 0 0 0 0 0 0 0 |. sup |. b 刪除除了末項外之所有 1 0 0 0 0 0 0 0 1 0 0 0 sup&.|. b 0 0 0 0 0 0 0 1 0 0 0 3 +&.^. 4 取對數、相加、再取逆對數 12 (^.3)+(^.4) 2.48491 ^ (^.3)+(^.4) 12 ]c=: 1 2 3;4 5;6 7 8 +-----+---+-----+ |1 2 3|4 5|6 7 8| +-----+---+-----+ |.&.> c 開啟,反向與封箱 +-----+---+-----+ |3 2 1|5 4|8 7 6| +-----+---+-----+
練習
27.1 | Use following as exercises in reading與writing.
Try using引數such as a=: 2 3 5 7 and b=: 1 2 3 4
and c=: <@i."0 i. 3 4 : f=: +&.^ Multiplication by addition of natural logs g=: +&.(10&^.) Multiplication using base-10 logs h=: *&.^ Addition from multiplication i=: |.&.> Reverse each box j=: +/&.> Sum each box k=: +/&> Sum each box與leave開啟 |