summaryrefslogblamecommitdiffstats
path: root/src/synth_math.h
blob: de6fb26677fe5354b3d82600c39fa47dcae0b8b2 (plain) (tree)





















                                        
#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 */