This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

44
cppdraft/numerics/c.md Normal file
View File

@@ -0,0 +1,44 @@
[numerics.c]
# 29 Numerics library [[numerics]](./#numerics)
## 29.11 C compatibility [numerics.c]
### [29.11.1](#stdckdint.h.syn) Header <stdckdint.h> synopsis [[stdckdint.h.syn]](stdckdint.h.syn)
[🔗](#header:%3cstdckdint.h%3e)
#define __STDC_VERSION_STDCKDINT_H__ 202311Ltemplate<class type1, class type2, class type3>bool ckd_add(type1* result, type2 a, type3 b);template<class type1, class type2, class type3>bool ckd_sub(type1* result, type2 a, type3 b);template<class type1, class type2, class type3>bool ckd_mul(type1* result, type2 a, type3 b);
[1](#stdckdint.h.syn-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20627)
See also: ISO/IEC 9899:2024, 7.20
### [29.11.2](#ckdint) Checked integer operations [[numerics.c.ckdint]](numerics.c.ckdint)
[🔗](#lib:ckd_add)
`template<class type1, class type2, class type3>
bool ckd_add(type1* result, type2 a, type3 b);
template<class type1, class type2, class type3>
bool ckd_sub(type1* result, type2 a, type3 b);
template<class type1, class type2, class type3>
bool ckd_mul(type1* result, type2 a, type3 b);
`
[1](#ckdint-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20645)
*Mandates*: Each of the types type1, type2, and type3 is a
cv-unqualified signed or unsigned integer type[.](#ckdint-1.sentence-1)
[2](#ckdint-2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20650)
*Remarks*: Each function template has the same semantics as
the corresponding type-generic macro with the same name
specified in ISO/IEC 9899:2024, 7.20[.](#ckdint-2.sentence-1)

View File

@@ -0,0 +1,32 @@
[numerics.c.ckdint]
# 29 Numerics library [[numerics]](./#numerics)
## 29.11 C compatibility [[numerics.c]](numerics.c#ckdint)
### 29.11.2 Checked integer operations [numerics.c.ckdint]
[🔗](#lib:ckd_add)
`template<class type1, class type2, class type3>
bool ckd_add(type1* result, type2 a, type3 b);
template<class type1, class type2, class type3>
bool ckd_sub(type1* result, type2 a, type3 b);
template<class type1, class type2, class type3>
bool ckd_mul(type1* result, type2 a, type3 b);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20645)
*Mandates*: Each of the types type1, type2, and type3 is a
cv-unqualified signed or unsigned integer type[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20650)
*Remarks*: Each function template has the same semantics as
the corresponding type-generic macro with the same name
specified in ISO/IEC 9899:2024, 7.20[.](#2.sentence-1)

View File

@@ -0,0 +1,29 @@
[numerics.defns]
# 26 Algorithms library [[algorithms]](./#algorithms)
## 26.10 Generalized numeric operations [[numeric.ops]](numeric.ops#numerics.defns)
### 26.10.2 Definitions [numerics.defns]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/algorithms.tex#L12270)
Define *GENERALIZED_NONCOMMUTATIVE_SUM*(op, a1, …, aN) as follows:
- [(1.1)](#1.1)
a1 when N is 1, otherwise
- [(1.2)](#1.2)
op(*GENERALIZED_NONCOMMUTATIVE_SUM*(op, a1, …, aK),
op(*GENERALIZED_NONCOMMUTATIVE_SUM*(op, aM, …, aN)) for any K where 1<K+1=‰¤N[.](#1.2.sentence-2)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/algorithms.tex#L12284)
Define *GENERALIZED_SUM*(op, a1, …, aN) as*GENERALIZED_NONCOMMUTATIVE_SUM*(op, b1, …, bN),
whereb1, …, bN may be any permutation of a1, …, aN[.](#2.sentence-1)

View File

@@ -0,0 +1,37 @@
[numerics.general]
# 29 Numerics library [[numerics]](./#numerics)
## 29.1 General [numerics.general]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L6)
This Clause describes components that C++ programs may use to perform
seminumerical operations[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10)
The following subclauses describe components for
complex number types, random number generation,
numeric (*n*-at-a-time)
arrays, generalized numeric algorithms, and
mathematical constants and functions for floating-point types,
as summarized in Table [125](#tab:numerics.summary "Table 125: Numerics library summary")[.](#2.sentence-1)
Table [125](#tab:numerics.summary) — Numerics library summary [[tab:numerics.summary]](./tab:numerics.summary)
| [🔗](#tab:numerics.summary-row-1) | **Subclause** | **Header** |
| --- | --- | --- |
| [🔗](#tab:numerics.summary-row-2)<br>[[numeric.requirements]](numeric.requirements "29.2Numeric type requirements") | Requirements | |
| [🔗](#tab:numerics.summary-row-3)<br>[[cfenv]](cfenv "29.3The floating-point environment") | Floating-point environment | <cfenv> |
| [🔗](#tab:numerics.summary-row-4)<br>[[complex.numbers]](complex.numbers "29.4Complex numbers") | Complex numbers | <complex> |
| [🔗](#tab:numerics.summary-row-5)<br>[[rand]](rand "29.5Random number generation") | Random number generation | <random> |
| [🔗](#tab:numerics.summary-row-6)<br>[[numarray]](numarray "29.6Numeric arrays") | Numeric arrays | <valarray> |
| [🔗](#tab:numerics.summary-row-7)<br>[[c.math]](c.math "29.7Mathematical functions for floating-point types") | Mathematical functions for floating-point types | <cmath>, <cstdlib> |
| [🔗](#tab:numerics.summary-row-8)<br>[[numbers]](numbers "29.8Numbers") | Numbers | <numbers> |
| [🔗](#tab:numerics.summary-row-9)<br>[[linalg]](linalg "29.9Basic linear algebra algorithms") | Linear algebra | <linalg> |
| [🔗](#tab:numerics.summary-row-10)<br>[[simd]](simd "29.10Data-parallel types") | Data-parallel types | <simd> |