Cleanup math.compare docs and tests

db4
Aaron Schaefer 2008-11-09 21:00:36 -05:00
parent 9a3c10d212
commit 46692390d4
2 changed files with 12 additions and 33 deletions

View File

@ -1,37 +1,23 @@
! Copyright (C) 2008 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: help.markup help.syntax ;
USING: help.markup help.syntax math ;
IN: math.compare
HELP: absmin
{ $values { "a" "a number" } { "b" "a number" } { "x" "a number" } }
{ $description
"Returns the smaller absolute number with the original sign."
} ;
{ $values { "a" number } { "b" number } { "x" number } }
{ $description "Returns the smaller absolute number with the original sign." } ;
HELP: absmax
{ $values { "a" "a number" } { "b" "a number" } { "x" "a number" } }
{ $description
"Returns the larger absolute number with the original sign."
} ;
{ $values { "a" number } { "b" number } { "x" number } }
{ $description "Returns the larger absolute number with the original sign." } ;
HELP: posmax
{ $values { "a" "a number" } { "b" "a number" } { "x" "a number" } }
{ $description
"Returns the most-positive value, or zero if both are negative."
} ;
{ $values { "a" number } { "b" number } { "x" number } }
{ $description "Returns the most-positive value, or zero if both are negative." } ;
HELP: negmin
{ $values { "a" "a number" } { "b" "a number" } { "x" "a number" } }
{ $description
"Returns the most-negative value, or zero if both are positive."
} ;
{ $values { "a" number } { "b" number } { "x" number } }
{ $description "Returns the most-negative value, or zero if both are positive." } ;
HELP: clamp
{ $values { "a" "a number" } { "value" "a number" } { "b" "a number" } { "x" "a number" } }
{ $description
"Returns the value when between 'a' and 'b', 'a' if <= 'a', or 'b' if >= 'b'."
} ;
{ $values { "a" number } { "value" number } { "b" number } { "x" number } }
{ $description "Returns the value when between " { $snippet "a" } " and " { $snippet "b" } ", " { $snippet "a" } " if <= " { $snippet "a" } ", or " { $snippet "b" } " if >= " { $snippet "b" } "." } ;

View File

@ -1,8 +1,4 @@
! Copyright (C) 2008 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: kernel math math.functions math.compare tools.test ;
USING: kernel math math.compare math.functions tools.test ;
IN: math.compare.tests
[ -1 ] [ -1 5 absmin ] unit-test
@ -23,6 +19,3 @@ IN: math.compare.tests
[ 1 ] [ 0 1 2 clamp ] unit-test
[ 2 ] [ 0 3 2 clamp ] unit-test