Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003-2005 Tom Wu | 2 * Copyright (c) 2003-2005 Tom Wu |
3 * All Rights Reserved. | 3 * All Rights Reserved. |
4 * | 4 * |
5 * Permission is hereby granted, free of charge, to any person obtaining | 5 * Permission is hereby granted, free of charge, to any person obtaining |
6 * a copy of this software and associated documentation files (the | 6 * a copy of this software and associated documentation files (the |
7 * "Software"), to deal in the Software without restriction, including | 7 * "Software"), to deal in the Software without restriction, including |
8 * without limitation the rights to use, copy, modify, merge, publish, | 8 * without limitation the rights to use, copy, modify, merge, publish, |
9 * distribute, sublicense, and/or sell copies of the Software, and to | 9 * distribute, sublicense, and/or sell copies of the Software, and to |
10 * permit persons to whom the Software is furnished to do so, subject to | 10 * permit persons to whom the Software is furnished to do so, subject to |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 while(--n >= 0) { | 88 while(--n >= 0) { |
89 var l = this[i]&0x3fff; | 89 var l = this[i]&0x3fff; |
90 var h = this[i++]>>14; | 90 var h = this[i++]>>14; |
91 var m = xh*l+h*xl; | 91 var m = xh*l+h*xl; |
92 l = xl*l+((m&0x3fff)<<14)+w[j]+c; | 92 l = xl*l+((m&0x3fff)<<14)+w[j]+c; |
93 c = (l>>28)+(m>>14)+xh*h; | 93 c = (l>>28)+(m>>14)+xh*h; |
94 w[j++] = l&0xfffffff; | 94 w[j++] = l&0xfffffff; |
95 } | 95 } |
96 return c; | 96 return c; |
97 } | 97 } |
98 if(j_lm && (typeof navigator != "undefined" && navigator.appName == "Microsoft I nternet Explorer")) { | 98 if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { |
Wladimir Palant
2016/09/25 13:02:28
Just define a navigator global in the tests, don't
kzar
2016/09/25 13:19:03
Yea, I wasn't thinking too hard when I changed thi
| |
99 BigInteger.prototype.am = am2; | 99 BigInteger.prototype.am = am2; |
100 dbits = 30; | 100 dbits = 30; |
101 } | 101 } |
102 else if(j_lm && (typeof navigator != "undefined" && navigator.appName != "Netsca pe")) { | 102 else if(j_lm && (navigator.appName != "Netscape")) { |
103 BigInteger.prototype.am = am1; | 103 BigInteger.prototype.am = am1; |
104 dbits = 26; | 104 dbits = 26; |
105 } | 105 } |
106 else { // Mozilla/Netscape seems to prefer am3 | 106 else { // Mozilla/Netscape seems to prefer am3 |
107 BigInteger.prototype.am = am3; | 107 BigInteger.prototype.am = am3; |
108 dbits = 28; | 108 dbits = 28; |
109 } | 109 } |
110 | 110 |
111 BigInteger.prototype.DB = dbits; | 111 BigInteger.prototype.DB = dbits; |
112 BigInteger.prototype.DM = ((1<<dbits)-1); | 112 BigInteger.prototype.DM = ((1<<dbits)-1); |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
579 BigInteger.prototype.negate = bnNegate; | 579 BigInteger.prototype.negate = bnNegate; |
580 BigInteger.prototype.abs = bnAbs; | 580 BigInteger.prototype.abs = bnAbs; |
581 BigInteger.prototype.compareTo = bnCompareTo; | 581 BigInteger.prototype.compareTo = bnCompareTo; |
582 BigInteger.prototype.bitLength = bnBitLength; | 582 BigInteger.prototype.bitLength = bnBitLength; |
583 BigInteger.prototype.mod = bnMod; | 583 BigInteger.prototype.mod = bnMod; |
584 BigInteger.prototype.modPowInt = bnModPowInt; | 584 BigInteger.prototype.modPowInt = bnModPowInt; |
585 | 585 |
586 // "constants" | 586 // "constants" |
587 BigInteger.ZERO = nbv(0); | 587 BigInteger.ZERO = nbv(0); |
588 BigInteger.ONE = nbv(1); | 588 BigInteger.ONE = nbv(1); |
LEFT | RIGHT |