factor/core/math/pow.facts

28 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2006-01-12 01:06:23 -05:00
USING: help math ;
2006-08-16 21:55:53 -04:00
HELP: exp
2006-01-12 01:06:23 -05:00
{ $values { "x" "a complex number" } { "y" "a complex number" } }
{ $description "Computes the exponential function." } ;
2006-08-16 21:55:53 -04:00
HELP: log
2006-01-12 01:06:23 -05:00
{ $values { "x" "a complex number" } { "y" "a complex number" } }
{ $description "Computes the natural logarithm function. Outputs negative infinity if " { $snippet "x" } " is 0." } ;
2006-08-16 21:55:53 -04:00
HELP: sqrt
2006-01-12 01:06:23 -05:00
{ $values { "x" "a complex number" } { "y" "a complex number" } }
{ $description "Computes the square root function." } ;
2006-08-16 21:55:53 -04:00
HELP: ^
2006-01-12 01:06:23 -05:00
{ $values { "x" "a complex number" } { "y" "a complex number" } { "z" "a complex number" } }
2006-01-20 04:58:12 -05:00
{ $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." }
2006-01-12 01:06:23 -05:00
{ $errors "Throws an error if " { $snippet "x" } " and " { $snippet "y" } " are both integer 0." } ;
2006-08-16 21:55:53 -04:00
HELP: power-of-2?
2006-01-12 01:06:23 -05:00
{ $values { "n" "an integer" } { "?" "a boolean" } }
{ $description "Tests if " { $snippet "n" } " is a power of 2." } ;
2006-08-16 21:55:53 -04:00
HELP: log2
2006-01-12 01:06:23 -05:00
{ $values { "n" "a positive integer" } { "b" "an integer" } }
{ $description "Computes the largest integer " { $snippet "b" } " such that " { $snippet "2^b" } " is less than " { $snippet "n" } "." }
{ $errors "Throws an error if " { $snippet "n" } " is zero or negative." } ;