RPGNext
Take Your RPG Development to theNextLevel
Site Links
Home
RPG Programming
xRPG Downloads
xRPG Docs
About This Site
About Me

RPG Gurus
Bob Cozzi
Brad Stone
Scott Klement
Jon Paris

iSeries Links
Alpha Works
Midrange.com
FAQ@Midrange.com
MidrangeServer.com
IBM Docs
iSeries Infocenter
MCPress
Easy400
API Finder

xRPG Core Library Procedures - RNBMATH: getGCD()


Calculate the Greatest Common Divisor (GCD) of two numbers.

The GCD is the greatest number by which both integers can be equally divided. EX. 15/25, both 15 and 25 can be equally divided by 5. For something like 17/23, both can only be equally divided by 1. The parameter order of the integers does not matter.

Usage:

getGCD( integer1 : integer2 );

Name Type Options Opt/Req Description
Integer 1 20i 0 Value Req The first integer.
Integer 2 20i 0 Value Req The second integer.
Returns: 20i 0 n/a n/a The Greatest Common Divisor.

This site conforms with the following W3C specifications:

Web Essentials

Contact