]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/math/quadratic/quadratic.factor
factor: trim using lists
[factor.git] / extra / math / quadratic / quadratic.factor
index e4642a863b4e4d4e6606b674ecd467b2d7201518..9281e4ba71d94a45fb70131c51823dfa4f2df099 100644 (file)
@@ -1,11 +1,11 @@
 ! Copyright (C) 2007 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel locals math math.functions ;
+USING: kernel math math.functions ;
 IN: math.quadratic
 
-: monic ( c b a -- c' b' ) tuck [ / ] 2bi@ ;
+: monic ( c b a -- c' b' ) [ / ] curry bi@ ;
 
-: discriminant ( c b -- b d ) tuck sq 4 / swap - sqrt ;
+: discriminant ( c b -- b d ) [ nip ] [ sq 4 / swap - sqrt ] 2bi ;
 
 : critical ( b d -- -b/2 d ) [ -2 / ] dip ;