Paste: comparisons

Author: mrjbq7
Mode: factor
Date: Tue, 23 Sep 2008 21:42:55
Plain Text |
: absmin ( a b -- x ) 
   [ [ abs ] dip abs < ] 2keep ? ;

: absmax ( a b -- x ) 
   [ [ abs ] dip abs > ] 2keep ? ;

: posmax ( a b -- x ) 
   0 max max ;

: negmin ( a b -- x ) 
   0 min min ;

: clamp ( a value b -- x )
   min max ; 

Annotation: Replacing [ abs ] dip abs

Author: William Schlieper
Mode: factor
Date: Wed, 24 Sep 2008 01:10:56
Plain Text |
[ abs ] dip abs

is better written as

[ abs ] bi@

New Annotation

Summary:
Author:
Mode:
Body: