diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2023-04-18 16:31:25 +0300 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2023-04-18 16:31:25 +0300 |
commit | 9c6410cc3a43d9d1e01f853cb5a8d0f8a6d93b45 (patch) | |
tree | a4c044223d224090e54828903ae223788f97c8e6 /src/synth_math.h | |
download | synth-project-9c6410cc3a43d9d1e01f853cb5a8d0f8a6d93b45.tar.gz synth-project-9c6410cc3a43d9d1e01f853cb5a8d0f8a6d93b45.tar.bz2 synth-project-9c6410cc3a43d9d1e01f853cb5a8d0f8a6d93b45.zip |
autotools initial...
Diffstat (limited to 'src/synth_math.h')
-rw-r--r-- | src/synth_math.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/synth_math.h b/src/synth_math.h new file mode 100644 index 0000000..de6fb26 --- /dev/null +++ b/src/synth_math.h @@ -0,0 +1,22 @@ +#ifndef SYNTH_MATH_H +#define SYNTH_MATH_H + +extern long long +gcd(long long int a, long long int b) +{ + long long rem; + rem=a-(a/b*b); + if(rem==0) + return b; + else + gcd(b,rem); +} + +// Function to return LCM of two numbers +extern long long +lcm(long long a, long long b) +{ + return (a / gcd(a, b)) * b; +} + +#endif /* SYNTH_MATH_H */ |