! Copyright (C) 2012 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
-USING: help.markup help.syntax kernel math math.functions sequences ;
+USING: help.markup help.syntax kernel math math.functions
+sequences ;
IN: math.extras
{ $description "Returns the " { $link sinc } " function, calculated according to " { $snippet "sin(pi * x) / (pi * x)" } ". The name " { $link sinc } " is short for \"sine cardinal\" or \"sinus cardinalis\"." }
{ $notes { $snippet "0 sinc" } " is the limit value of 1." } ;
-HELP: linspace[a,b)
+HELP: linspace[a..b)
{ $values { "a" number } { "b" number } { "length" integer } { "seq" sequence } }
{ $description "Return evenly spaced numbers over an interval " { $snippet "[a,b)" } "." } ;
-HELP: linspace[a,b]
+HELP: linspace[a..b]
{ $values { "a" number } { "b" number } { "length" integer } { "seq" sequence } }
{ $description "Return evenly spaced numbers over an interval " { $snippet "[a,b]" } "." } ;
-HELP: logspace[a,b)
+HELP: logspace[a..b)
{ $values { "a" number } { "b" number } { "length" integer } { "base" number } { "seq" sequence } }
{ $description "Return evenly spaced numbers on a log scaled interval " { $snippet "[base^a,base^b)" } "." } ;
-HELP: logspace[a,b]
+HELP: logspace[a..b]
{ $values { "a" number } { "b" number } { "length" integer } { "base" number } { "seq" sequence } }
{ $description "Return evenly spaced numbers on a log scaled interval " { $snippet "[base^a,base^b]" } "." } ;
{ $example "USING: math.extras prettyprint ;" "12345.6789 -3 round-to-decimal ." "12000.0" }
} ;
-HELP: round-to-even
-{ $values { "x" real } { "y" real } }
-{ $description "Rounds " { $snippet "x" } " towards the nearest even number. This is also known as banker's rounding or unbiased rounding." }
-{ $examples
- { $example "USING: math.extras prettyprint ;" "0.5 round-to-even ." "0.0" }
- { $example "USING: math.extras prettyprint ;" "1.5 round-to-even ." "2.0" } } ;
-
HELP: kahan-sum
{ $values { "seq" sequence } { "n" float } }
{ $description "Calculates the summation of the sequence using the Kahan summation algorithm." } ;