Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
Vašek edited this page Feb 7, 2019 · 3 revisions

gcd

This function returns the greatest common divisor of the given numbers

Syntax:

gcd(n, x)
Argument Description
int n First number
int x The other number

Returns: int

Description:

The greatest common divisor of two numbers is the largest positive integer that divides each of the integers. For example: What is the greatest common divisor of 72 and 24?

Divisors of 72 are:

Divisors of 24 are:

Their greatest common divisor is 24.

Example:

int value = gcd(54, 24);

This function sets value to 6.

Back to number_functions

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /