⎕pw ← 95 ⍝ The square root of ¯1, a pure imaginary number. ⍙J ← 0J1 ⍝ CMPLX is an array function. ∇ z ← m CMPLX n z ← m + ⍙J × n ∇ ⍝ CMPLX0 is a scalar function. ∇ z ← CMPLX0 a; m; n ( m n ) ← a z ← m + ⍙J × n ∇ ⍝ Euclidean division algorithm for Gaussian integers. ⍝ DIVJ is a scalar function. ∇ z ← a DIVJ b; q → ( b ≠ 0J0 ) / L0 z ← 0 a → 0 L0: z ← q , a - b × q ← CMPLX0 ⌊ ( 9 11 ) ○ a ÷ b ∇ ⍝ Modulo function for Gaussian integers. A test replacement for current ⍝ gnu-apl ∣ function applied to Gaussian integers. ⍝ MODJ is a scalar function. ∇ z ← a MODJ b z ← ↑ ¯1 ↑ b DIVJ a ∇ ∇ z ← NORMJ m z ← m × + m ∇ ∇ z ← SUE v z ← ( ( v ⍳ v ) = ⍳ ⍴ v ) / v ∇ ∇ PLOT; ia; ra; bg; dmn; crs; unq; crsr; crsi; n; i ia ← 32 1 ⍴ ( 15 ⍴ ' ' ) , '-' , 16 ⍴ ' ' ra ← ( 45 ⍴ ' ' ) , ' | ' , 45 ⍴ ' ' bg ← ia , ( 31 93 ⍴ ' ∘ ' ) ,[ 1 ] ra bgn ← ¯16 rng ← 31 dmn ← bgn + ⍳ rng beta ← dmn ∘.+ 0J1 × dmn crs ← , ( ⎕ ← 2J6 ) ∣ beta unq ← ( crs ⍳ crs ) = ⍳ ⍴ crs ⎕ ← ⍴ ⎕ ← ucrs ← unq / crs crsr ← 9 ○ ucrs crsr ← 3 × 16 + crsr crsi ← 11 ○ ucrs crsi ← 16 + crsi n ← ⍴ crsr i ← 0 L0: → ( i ≥ n ) / L1 i ← i + 1 bg[ crsi[ i ] ; crsr[ i ] ] ← '⎕' → L0 L1: " " ⊖bg ∇ PLOT