math.functions: adding docs and tests for ^mod.

db4
John Benediktsson 2012-04-19 08:20:11 -07:00
parent 8c1165cac1
commit 1e8eb18216
2 changed files with 6 additions and 0 deletions

View File

@ -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" } ":"

View File

@ -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