]> gitweb.factorcode.org Git - factor.git/blob - core/math/pow.facts
more sql changes
[factor.git] / core / math / pow.facts
1 USING: help math ;
2
3 HELP: exp
4 { $values { "x" "a complex number" } { "y" "a complex number" } }
5 { $description "Computes the exponential function." } ;
6
7 HELP: log
8 { $values { "x" "a complex number" } { "y" "a complex number" } }
9 { $description "Computes the natural logarithm function. Outputs negative infinity if " { $snippet "x" } " is 0." } ;
10
11 HELP: sqrt
12 { $values { "x" "a complex number" } { "y" "a complex number" } }
13 { $description "Computes the square root function." } ;
14
15 HELP: ^
16 { $values { "x" "a complex number" } { "y" "a complex number" } { "z" "a complex number" } }
17 { $description "Raises " { $snippet "x" } " to the power of " { $snippet "y" } ". If " { $snippet "y" } " is an integer the answer is computed exactly, otherwise a floating point approximation is used." }
18 { $errors "Throws an error if " { $snippet "x" } " and " { $snippet "y" } " are both integer 0." } ;
19
20 HELP: power-of-2?
21 { $values { "n" "an integer" } { "?" "a boolean" } }
22 { $description "Tests if " { $snippet "n" } " is a power of 2." } ;
23
24 HELP: log2
25 { $values { "n" "a positive integer" } { "b" "an integer" } }
26 { $description "Computes the largest integer " { $snippet "b" } " such that " { $snippet "2^b" } " is less than " { $snippet "n" } "." }
27 { $errors "Throws an error if " { $snippet "n" } " is zero or negative." } ;