summaryrefslogtreecommitdiff
path: root/format.h
diff options
context:
space:
mode:
Diffstat (limited to 'format.h')
-rw-r--r--format.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/format.h b/format.h
index 2f9c1b4..d0cf95a 100644
--- a/format.h
+++ b/format.h
@@ -20,6 +20,23 @@ const char caps[2][26] = {
'n','o','p','q','r','s','t','u','v','w','x','y','z'}
};
+int pow(int b, int e){
+ int result =1;
+ for (int i = 0; i<e; i++){
+ result *= b;
+ }
+ return result;
+}
+
+float avg(float arr[]){
+ int len = COUNT_OF(arr);
+ float sum = 0;
+ for (int i=0;i<len;i++){
+ sum += arr[i];
+ }
+ return sum/len;
+}
+
// Convert every character to lowercase
char * lower(char *str){
int len = COUNT_OF(str);