Computes the greatest common divisor of two values.

Syntax

Result = SRP_Math("GCD", Value1, Value2, DecimalPlaces, ScientificNotation)

Returns

The greatest common divisor of Value1 and Value2.

Remarks

The GCD operation computes the greatest common divisor of Value1 and Value2. Both Value1 and Value2 must be integers, else the following error is returned:

"ERROR: Integer inputs required."

Example

// Find the GCD of of 333333333333333333333 and 18181818181818181818 
Val1 = "33333333333333333333" 
Val2 = "18181818181818181818" 
Result = SRP_Math("GCM", Val1, Val2) 
!! Result = 3030303030303030303.0 !! 
// Attempting to find the GCD of PI and E results in an error 
Val1 = "3.1415926535897932384626433832795" 
Val2 = "2.7182818284590452353602874713527" 
Result = SRP_Math("GCM", Val1, Val2) 
!! Result = "ERROR: Integer inputs required." !!
  • No labels