From d8f3b64d53594ce7b1c6357865b07742fe8bf3dd Mon Sep 17 00:00:00 2001 From: fdai7057 Date: Thu, 2 Feb 2023 10:18:43 +0100 Subject: [PATCH] refactoring: change variable names to increase readability. --- src/stringManipulation.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/stringManipulation.c b/src/stringManipulation.c index 8fb83eb..37c9f89 100644 --- a/src/stringManipulation.c +++ b/src/stringManipulation.c @@ -54,14 +54,14 @@ char *to_string(int number) } } -unsigned int power(unsigned int b, unsigned int n){ - if(b==0&&n==0) return 0; - else if(b>=1&&n==0) return 1; +unsigned int power(unsigned int base, unsigned int exponent){ + if(base==0&&exponent==0) return 0; + else if(base>=1&&exponent==0) return 1; else{ - unsigned int result = 1, ctr = 0; - while(ctr