Skip to content
Browse files

describe chained MPI operations in pod

git-svn-id: svn://localhost/Crypt-GCrypt/trunk@86 c2f821fb-fd85-dc11-8383-000bcdcb7a8f
  • Loading branch information...
1 parent b17d60a commit afebd65fdc99279728c81978052a03cacb3bfeb1 dkg committed Jan 23, 2010
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/Crypt/GCrypt/MPI.pm
View
10 lib/Crypt/GCrypt/MPI.pm
@@ -116,6 +116,16 @@ identical to "$a = Crypt::GCrypt::MPI->new($b);"
=head1 CALCULATIONS
+All calculation operations modify the object they are called on, and
+return the same object, so you can chain them like this:
+
+ $g->addm($a, $m)->mulm($b, $m)->gcd($x);
+
+If you don't want an operation to affect the initial object, use the
+copy() operator:
+
+ $h = $g->copy()->addm($a, $m)->mulm($b, $m)->gcd($x);
+
=head2 add($other)
Adds the value of $other to this MPI.

0 comments on commit afebd65

Please sign in to comment.
Something went wrong with that request. Please try again.