peter <pete…@tin.it> writes:
>Here is a version that corrects this. > >over 0 >= if > swap over 1024 swap - min swap else \ limit positive n > dup 0<= if nip 0 swap else \ limit negative n when e negative > 1 over - rot max swap then then \ limit negative n
Can this be simplified? Here's what I came up with: over 0 >= if 1024 2 pick - rot min else dup 0<= if nip 0 else 1 over - rot max then then swap Or, using CASE with ?OF: case dup 0 >= ?of 1024 2 pick - rot min endof dup 0<= ?of nip 0 endof 1 over - rot max 0 endcase swap - anton