Skip to content

Commit 174458a

Browse files
committed
adding more primes and optimized function to return faster
1 parent 59a51f5 commit 174458a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/traces/surface/convert.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,21 @@ var shortPrimes = [
127127
1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699,
128128
1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789,
129129
1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889,
130-
1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999
130+
1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999,
131+
2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099,
132+
2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179,
133+
2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297,
134+
2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399,
135+
2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477,
136+
2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593,
137+
2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699,
138+
2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797,
139+
2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897,
140+
2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999
131141
];
132142

133143
function getPow(a, b) {
144+
if(a < b) return 0;
134145
var n = 0;
135146
while(Math.floor(a % b) === 0) {
136147
a /= b;

0 commit comments

Comments
 (0)