Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fit armstrong_number.cpp to guidelines #2457

Merged
merged 12 commits into from
Jun 20, 2023
Prev Previous commit
Next Next commit
chore: delete unnecessary whitespace
  • Loading branch information
realstealthninja committed May 1, 2023
commit bcd03b4b70f4c84d0636f9f70f0c7f40f72f166c
10 changes: 5 additions & 5 deletions math/armstrong_number.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
* \f$ d_i = \frac{n mod b^{i+1} - n mod b^{i}}{b^{i}} \f$
*
* @author [Neeraj Cherkara](https://github.com/iamnambiar)
*/
*/
#include <cassert> /// for assert
#include <cmath> /// for std::pow

/**
* @brief Function to calculate the total number of digits in the number.
* @param num Number
* @return Total number of digits.
*/
*/
int number_of_digits(int num) {
int total_digits = 0;
while (num > 0) {
Expand All @@ -38,7 +38,7 @@ int number_of_digits(int num) {
* @param number to be checked
* @return `true` if the number is armstrong.
* @return `false` if the number is not armstrong.
*/
*/
bool is_armstrong(int number) {
// If the number is less than 0, then it is not an armstrong number.
if (number < 0) {
Expand All @@ -62,7 +62,7 @@ bool is_armstrong(int number) {
/**
* @brief Self-test implementations
* @returns void
*/
*/
static void test() {
// is_armstrong(370) returns true.
assert(is_armstrong(370) == true);
Expand All @@ -81,7 +81,7 @@ static void test() {
/**
* @brief Main Function
* @returns 0 on exit
*/
*/
int main() {
test(); // run self-test implementations
return 0;
Expand Down