Brian Dunning's FileMaker Custom Functions

GCF ( A ; B )

Greatest Common Factor of two numbers

  Average rating: 4.4 (28 votes) Log in to vote

Scott Morrison   Scott Morrison
InDev
http://www.indev.ca

Share on Facebook Share on Twitter

  Sample input:
GCF ( 126 , 324 )
  Sample output:
18

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Uses Euclid's method of recursively computing the GCF (the GCF of two numbers is the same as the GCF of the smaller and the remainder (modula) of the larger divided by the smaller; and by definition, the GCF of any number and 0 is the number)

Note that the lowest common multiple of two numbers is their product divided by their GCF. In otherwords:
LCM(A, B) = A * B / GCF(A,B)

 

Comments

Peter Kelley   Peter Kelley, St. Paul, MN USA
Feb 6, 2014
This will be my first attenot to impliment of a Custom Fucntion with in FileMaker. I nearly need step by step instuctions as to how to set one up. The GCF Function is one that I need, but I also seek the Greatest Common Divisor (GCD) so I can constuct ratios exressions (34:1).

Might you be able to aide me?

Peter Kelley
St. Paul, MN USA
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: