tweetcast/client/lib/gimite-web-socket-js-55ae639/flash-src/third-party/com/hurlant/math/ClassicReduction.as
changeset 306 70c9688a1486
parent 305 436a31d11f1d
parent 291 db1e6bfaa54e
child 307 6872c6aac6d6
--- a/tweetcast/client/lib/gimite-web-socket-js-55ae639/flash-src/third-party/com/hurlant/math/ClassicReduction.as	Thu Oct 06 11:56:48 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-package com.hurlant.math
-{
-	use namespace bi_internal;
-	
-	/**
-	 * Modular reduction using "classic" algorithm
-	 */
-	internal class ClassicReduction implements IReduction
-	{
-		private var m:BigInteger;
-		public function ClassicReduction(m:BigInteger) {
-			this.m = m;
-		}
-		public function convert(x:BigInteger):BigInteger {
-			if (x.s<0 || x.compareTo(m)>=0) {
-				return x.mod(m);
-			}
-			return x;
-		}
-		public function revert(x:BigInteger):BigInteger {
-			return x;
-		}
-		public function reduce(x:BigInteger):void {
-			x.divRemTo(m, null,x);
-		}
-		public function mulTo(x:BigInteger, y:BigInteger, r:BigInteger):void {
-			x.multiplyTo(y,r);
-			reduce(r);
-		}
-		public function sqrTo(x:BigInteger, r:BigInteger):void {
-			x.squareTo(r);
-			reduce(r);
-		}
-	}
-}
\ No newline at end of file