From 9c6410cc3a43d9d1e01f853cb5a8d0f8a6d93b45 Mon Sep 17 00:00:00 2001 From: gramanas Date: Tue, 18 Apr 2023 16:31:25 +0300 Subject: autotools initial... --- src/synth_math.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/synth_math.h (limited to 'src/synth_math.h') 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 */ -- cgit v1.2.3