Dfn: Difference between revisions
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
3 {⍵*÷⍺} 27 ⍝ ⍺th root | 3 {⍵*÷⍺} 27 ⍝ ⍺th root | ||
3 | 3 | ||
⍝ Multiline dfn with optional left parameter | ⍝ Multiline dfn with optional left parameter and conditional result | ||
root←{ | root←{ | ||
⍺←2 ⍝ square root by default | ⍺←2 ⍝ square root by default | ||
⍺=0:0 ⍝ return zero if zeroth root | |||
⍺=0:0 ⍝ zero if zeroth root | |||
⍵*÷⍺ ⍝ result | ⍵*÷⍺ ⍝ result | ||
}</source> | }</source> |