Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools.c')
-rw-r--r--src/tools.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tools.c b/src/tools.c
index 2b7e85d..5912819 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -1,5 +1,5 @@
/*
-Copyright 2015 Ian Jauslin
+Copyright 2015-2022 Ian Jauslin
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -140,3 +140,13 @@ int min(int x1, int x2){
return(x2);
}
}
+
+// check whether a divides b
+int is_factor(int a, int b){
+ if(b-a*(b/a)==0){
+ return(1);
+ }
+ else{
+ return(0);
+ }
+}