[Jprogramming] newbie help: how to avoid division by zero

David Ward Lambert b49P23TIvg at stny.rr.com
Mon May 20 16:23:53 UTC 2013


I'd replace ([ * 1 - ]) with (* -.) .
As previously observed, 13 :'quoted expression' won't write hooks.

   (([ * 1 - ]) -: (* -.)) -:i:8     NB. monad
1
   (([ * 1 - ])/ -: (* -.)/)~ -:i:8  NB. dyad
1
   
>Date: Sun, 19 May 2013 11:43:52 -0400
>From: "Linda Alvord" <lindaalvord at verizon.net>
>To: <programming at jsoftware.com>
>Subject: Re: [Jprogramming] newbie help: how to avoid division by zero
>Message-ID: <000101ce54a7$aa2d4c10$fe87e430$@net>
>Content-Type: text/plain; charset=US-ASCII
>
> It is worth noting further simplification by J:
>
>   veco=: 13 :'(c*1+3*y) + (halve y) * (1-c =. odd y)' 
>   veco
>halve (* + [ * 1 - ]) odd
>   
>Linda




More information about the Programming mailing list