math.functions[-docs]: rename the output parameters of the power functions
parent
30f73d63f4
commit
c6208e4677
|
@ -101,7 +101,7 @@ HELP: align
|
||||||
{ $notes "This word will give an incorrect result if " { $snippet "w" } " is not a power of 2." } ;
|
{ $notes "This word will give an incorrect result if " { $snippet "w" } " is not a power of 2." } ;
|
||||||
|
|
||||||
HELP: e^
|
HELP: e^
|
||||||
{ $values { "x" number } { "y" number } }
|
{ $values { "x" number } { "e^x" number } }
|
||||||
{ $description "Exponential function, " { $snippet "y=e^x" } "." } ;
|
{ $description "Exponential function, " { $snippet "y=e^x" } "." } ;
|
||||||
|
|
||||||
HELP: frexp
|
HELP: frexp
|
||||||
|
@ -261,7 +261,7 @@ HELP: absq
|
||||||
{ $description "Computes the squared absolute value of a number. For complex numbers this is marginally more efficient than " { $link abs } "." } ;
|
{ $description "Computes the squared absolute value of a number. For complex numbers this is marginally more efficient than " { $link abs } "." } ;
|
||||||
|
|
||||||
HELP: ^
|
HELP: ^
|
||||||
{ $values { "x" number } { "y" number } { "z" number } }
|
{ $values { "x" number } { "y" number } { "x^y" number } }
|
||||||
{ $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." }
|
{ $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." }
|
||||||
{ $errors "Throws an error if " { $snippet "x" } " and " { $snippet "y" } " are both integer 0." } ;
|
{ $errors "Throws an error if " { $snippet "x" } " and " { $snippet "y" } " are both integer 0." } ;
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ HELP: nth-root
|
||||||
{ $description "Calculates the nth root of a number, such that " { $snippet "y^n=x" } "." } ;
|
{ $description "Calculates the nth root of a number, such that " { $snippet "y^n=x" } "." } ;
|
||||||
|
|
||||||
HELP: 10^
|
HELP: 10^
|
||||||
{ $values { "x" number } { "y" number } }
|
{ $values { "x" number } { "10^x" number } }
|
||||||
{ $description "Raises 10 to the power of " { $snippet "x" } ". If " { $snippet "x" } " is an integer the answer is computed exactly, otherwise a floating point approximation is used." } ;
|
{ $description "Raises 10 to the power of " { $snippet "x" } ". If " { $snippet "x" } " is an integer the answer is computed exactly, otherwise a floating point approximation is used." } ;
|
||||||
|
|
||||||
HELP: divisor?
|
HELP: divisor?
|
||||||
|
|
|
@ -61,7 +61,7 @@ PRIVATE>
|
||||||
|
|
||||||
: polar> ( abs arg -- z ) cis * ; inline
|
: polar> ( abs arg -- z ) cis * ; inline
|
||||||
|
|
||||||
GENERIC: e^ ( x -- y )
|
GENERIC: e^ ( x -- e^x )
|
||||||
|
|
||||||
M: float e^ fexp ; inline
|
M: float e^ fexp ; inline
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ M: complex e^ >rect [ e^ ] dip polar> ; inline
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: ^ ( x y -- z )
|
: ^ ( x y -- x^y )
|
||||||
{
|
{
|
||||||
{ [ over zero? ] [ 0^ ] }
|
{ [ over zero? ] [ 0^ ] }
|
||||||
{ [ dup integer? ] [ integer^ ] }
|
{ [ dup integer? ] [ integer^ ] }
|
||||||
|
@ -227,7 +227,7 @@ M: object log1+ 1 + log ; inline
|
||||||
|
|
||||||
M: float log1+ dup -1.0 >= [ flog1+ ] [ 1.0 + 0.0 rect> log ] if ; inline
|
M: float log1+ dup -1.0 >= [ flog1+ ] [ 1.0 + 0.0 rect> log ] if ; inline
|
||||||
|
|
||||||
: 10^ ( x -- y ) 10 swap ^ ; inline
|
: 10^ ( x -- 10^x ) 10 swap ^ ; inline
|
||||||
|
|
||||||
GENERIC: log10 ( x -- y ) foldable
|
GENERIC: log10 ( x -- y ) foldable
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue