From aaeb1815e03d85650ebba8a8f45fbe56e46db113 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sat, 23 Oct 2021 22:16:10 +0000 Subject: [PATCH] clang-format and clang-tidy fixes for bd135686 --- math/check_prime.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/math/check_prime.cpp b/math/check_prime.cpp index 1e1bd975a..a7b313551 100644 --- a/math/check_prime.cpp +++ b/math/check_prime.cpp @@ -7,12 +7,13 @@ * @brief * Reduced all possibilities of a number which cannot be prime. * Eg: No even number, except 2 can be a prime number, hence we will increment - * our loop with i+6 jumping and check for i or i+2 to be a factor of the number; - * if it's a factor then we will return false otherwise true after the loop terminates at the terminating condition which is (i*i<=num) + * our loop with i+6 jumping and check for i or i+2 to be a factor of the + * number; if it's a factor then we will return false otherwise true after the + * loop terminates at the terminating condition which is (i*i<=num) */ -#include /// for assert -#include /// for IO operations +#include /// for assert +#include /// for IO operations /** * Function to check if the given number is prime or not. @@ -24,14 +25,13 @@ bool is_prime(T num) { bool result = true; if (num <= 1) { return false; - } else if (num == 2 || num==3) { + } else if (num == 2 || num == 3) { return true; - } else if ((num%2) == 0 || num%3 == 0) { + } else if ((num % 2) == 0 || num % 3 == 0) { return false; - } - else { + } else { for (T i = 5; (i * i) <= (num); i = (i + 6)) { - if ((num % i) == 0 || (num%(i+2)==0 )) { + if ((num % i) == 0 || (num % (i + 2) == 0)) { result = false; break; }