math.functions: adding docs and tests for ^mod.
parent
8c1165cac1
commit
1e8eb18216
|
@ -292,6 +292,10 @@ HELP: mod-inv
|
|||
{ $example "USING: math prettyprint ;" "173 815 * 1119 mod ." "1" }
|
||||
} ;
|
||||
|
||||
HELP: ^mod
|
||||
{ $values { "x" real } { "y" real } { "n" real } { "z" real } }
|
||||
{ $description "Outputs the result of computing " { $snippet "x^y mod n" } "." } ;
|
||||
|
||||
HELP: ~
|
||||
{ $values { "x" real } { "y" real } { "epsilon" real } { "?" "a boolean" } }
|
||||
{ $description "Tests if " { $snippet "x" } " and " { $snippet "y" } " are approximately equal to each other. There are three possible comparison tests, chosen based on the sign of " { $snippet "epsilon" } ":"
|
||||
|
|
|
@ -178,6 +178,8 @@ CONSTANT: log10-factorial-1000 0x1.40f3593ed6f8ep11
|
|||
|
||||
[ 2 10 mod-inv ] must-fail
|
||||
|
||||
[ t ] [ 15 37 137 ^mod 15 37 ^ 137 mod = ] unit-test
|
||||
|
||||
[ t ] [ 0 0 ^ fp-nan? ] unit-test
|
||||
[ 1 ] [ 10 0 ^ ] unit-test
|
||||
[ 1/8 ] [ 1/2 3 ^ ] unit-test
|
||||
|
|
Loading…
Reference in New Issue