[ratio.general]

# 21 Metaprogramming library [[meta]](./#meta)

## 21.5 Compile-time rational arithmetic [[ratio]](ratio#general)

### 21.5.1 General [ratio.general]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L7036)

Subclause [[ratio]](ratio "21.5 Compile-time rational arithmetic") describes the ratio library[.](#1.sentence-1)

It provides a class templateratio which exactly represents any finite rational number with a
numerator and denominator representable by compile-time constants of typeintmax_t[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L7043)

Throughout subclause [[ratio]](ratio "21.5 Compile-time rational arithmetic"), the names of template parameters are used to express
type requirements[.](#2.sentence-1)

If a template parameter is named R1 or R2,
and the template argument is not a specialization of the ratio template,
the program is ill-formed[.](#2.sentence-2)
