Files
2025-10-25 03:02:53 +03:00

28 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[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.5Compile-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.5Compile-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)