Skip to content

Commit

Permalink
fix test on non-linux platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 7, 2024
1 parent cff2846 commit aef147f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cplusplus/src/tests/test_is_prime.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <iostream>
#include <stdint.h>
#include "../include/primes.hpp"

#ifndef MAX_PRIME
Expand All @@ -7,9 +8,8 @@

int main(int argc, char const *argv[]) {
// prints number, is_prime(), is_composite(), prime index or -1
PrimeGenerator<uintmax_t> pc = primes_until<uintmax_t>(MAX_PRIME);
uintmax_t i, p, prev = 0, count = 0;
p = pc.next();
PrimeGenerator<uint64_t> pc = primes_until<uint64_t>(MAX_PRIME);
uint64_t i, prev = 0, count = 0, p = pc.next();
while (p < MAX_PRIME && pc.has_next()) {
for (i = prev + 1; i < p; i++)
std::cout << i << " " << is_prime(i) << " " << is_composite(i) << " -1" << std::endl;
Expand Down

0 comments on commit aef147f

Please sign in to comment.