summaryrefslogtreecommitdiff
path: root/ripser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ripser.cpp')
-rw-r--r--ripser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ripser.cpp b/ripser.cpp
index 183fbc4..ffb514f 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -804,8 +804,8 @@ void compute_pairs(
#endif
}
-bool is_prime(const long n) {
- for (int i = 2; i <= n/2; ++i) if (n%i == 0) return false;
+bool is_prime(const unsigned long n) {
+ for (unsigned long i = 2; i*i <= n; ++i) if (n%i == 0) return false;
return true;
}