# \gcd

Used for greatest-common-divisor notation in number theory and algebra.

https://texform.dev/latex/commands/gcd

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Functions and operators](https://texform.dev/latex/topics/functions) |
| Packages | base |
| Allowed mode | math |
| Tags |  |
| Commonality | medium |
| Kind | prefix |

## Syntax

### base

Argument specification: ``

Used for greatest-common-divisor notation in number theory and algebra.

## Examples

```latex
\gcd
```

[Open in Playground](https://play.texform.dev/?input=%5Cgcd)

```latex
\gcd(a, b)
```

[Open in Playground](https://play.texform.dev/?input=%5Cgcd%28a%2C+b%29)

```latex
\gcd_{i}
```

[Open in Playground](https://play.texform.dev/?input=%5Cgcd_%7Bi%7D)

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| base | full | full | full |

## Usage frequency

0.04% of formulas in the measured corpus contain this entry, rank 136 of 263 entries with frequency data.

## In TeXForm

TeXForm parses this entry as prefix syntax; the package determines its argument specification.

## Equivalent forms

```latex
\operatorname*{gcd}
```

exact. Using amsmath

## See also

- [\\det](https://texform.dev/latex/commands/det)
- [\\inf](https://texform.dev/latex/commands/inf)
- [\\injlim](https://texform.dev/latex/commands/injlim)
- [\\lim](https://texform.dev/latex/commands/lim)
- [\\liminf](https://texform.dev/latex/commands/liminf)
- [\\limsup](https://texform.dev/latex/commands/limsup)
- [\\max](https://texform.dev/latex/commands/max)
- [\\min](https://texform.dev/latex/commands/min)
- [\\Pr](https://texform.dev/latex/commands/Pr)
- [\\projlim](https://texform.dev/latex/commands/projlim)
- [\\sup](https://texform.dev/latex/commands/sup)

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \gcd | Positive: baseline | Pass | Pass | Pass |
