Mercurial > hg > jgplsrc
view test/gsdot.ijs @ 0:e0bbaa717f41 draft default tip
lol J
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Mon, 25 Nov 2013 11:56:30 -0500 |
parents | |
children |
line wrap: on
line source
NB. S: ------------------------------------------------------------------ phi=: * -.@%@~.&.q: NB. Euler's totient function t=: 5!:2 <'phi' (;:'* -.@%@~.&.q:') -: < S: 0 t (0 0;0 0) -: (] S: 0) L: 1 t=: 2 $ <0;0 (0 0;0 0) -: (] S: 0) L: _1 t=: 2 $ <0;0 (0 0;0 0) -: > L: 1 t=: 2 $ <0;0 'domain error' -: ] S: 1 etx 1;<<1 2 3 'domain error' -: ; S: 2 etx 1;<<1 2 3 4!:55 ;:'phi t'