Skip to content

Commit f5bb67e

Browse files
authored
Merge pull request MicrosoftDocs#3146 from TylerMSFT/twhitney-tgmath
crosslink tgmath.h
2 parents 6f96c27 + 275fb81 commit f5bb67e

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

docs/c-runtime-library/complex-math-support.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "C complex math support"
3+
description: "Describes C-language complex math support in the Microsoft C runtime library (CRT)"
34
ms.date: "05/14/2019"
45
f1_keywords: ["c.complex"]
56
helpviewer_keywords: ["complex numbers, math routines", "math routines", "complex numbers"]
@@ -89,4 +90,5 @@ Because complex numbers are not a native type in the Microsoft compiler, the sta
8990

9091
## See also
9192

92-
[Universal C runtime routines by category](../c-runtime-library/run-time-routines-by-category.md)<br/>
93+
[Type-generic math](tgmath.md)\
94+
[Universal C runtime routines by category](../c-runtime-library/run-time-routines-by-category.md)

docs/c-runtime-library/floating-point-support.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "Math and floating-point support"
3-
ms.date: "01/31/2019"
3+
description: "Describes floating-point support in the Microsoft Universal C Runtime library (UCRT)"
4+
ms.date: "9/14/2020"
45
f1_keywords: ["c.math"]
56
helpviewer_keywords: ["floating-point numbers, math routines", "math routines", "floating-point numbers"]
67
ms.assetid: e4fcaf69-5c8e-4854-a9bb-1f412042131e
@@ -9,6 +10,8 @@ ms.assetid: e4fcaf69-5c8e-4854-a9bb-1f412042131e
910

1011
The Universal C Runtime library (UCRT) provides many integral and floating-point math library functions, including all of those required by ISO C99. The floating-point functions are implemented to balance performance with correctness. Because producing the correctly rounded result may be prohibitively expensive, these functions are designed to efficiently produce a close approximation to the correctly rounded result. In most cases, the result produced is within +/-1 ulp of the correctly rounded result, though there may be cases where there is greater inaccuracy.
1112

13+
For ISO C Standard 11 (C11) and later, the \<tgmath.h> header, in addition to including \<math.h> and \<complex.h>, provides macros that invoke a corresponding math function based on the types of the parameters. See [Type-generic math](tgmath.md) for details.
14+
1215
Many of the floating point math library functions have different implementations for different CPU architectures. For example, the 32-bit x86 CRT may have a different implementation than the 64-bit x64 CRT. In addition, some of the functions may have multiple implementations for a given CPU architecture. The most efficient implementation is selected dynamically at run-time depending on the instruction sets supported by the CPU. For example, in the 32-bit x86 CRT, some functions have both an x87 implementation and an SSE2 implementation. When running on a CPU that supports SSE2, the faster SSE2 implementation is used. When running on a CPU that does not support SSE2, the slower x87 implementation is used. Because different implementations of the math library functions may use different CPU instructions and different algorithms to produce their results, the functions may produce different results across CPUs. In most cases, the results are within +/-1 ulp of the correctly rounded result, but the actual results may vary across CPUs.
1316

1417
Previous 16-bit versions of Microsoft C/C++ and Microsoft Visual C++ supported the **`long double`** type as an 80-bit precision floating-point data type. In later versions of Visual C++, the **`long double`** data type is a 64-bit precision floating-point data type identical to the **`double`** type. The compiler treats **`long double`** and **`double`** as distinct types, but the **`long double`** functions are identical to their **`double`** counterparts. The CRT provides **`long double`** versions of the math functions for ISO C99 source code compatibility, but note that the binary representation may differ from other compilers.
@@ -127,5 +130,5 @@ Previous 16-bit versions of Microsoft C/C++ and Microsoft Visual C++ supported t
127130

128131
## See also
129132

130-
[Universal C runtime routines by category](../c-runtime-library/run-time-routines-by-category.md)<br/>
131-
[Floating-point primitives](../c-runtime-library/reference/floating-point-primitives.md)<br/>
133+
[Universal C runtime routines by category](../c-runtime-library/run-time-routines-by-category.md)\
134+
[Floating-point primitives](../c-runtime-library/reference/floating-point-primitives.md)

docs/c-runtime-library/recommendations-for-choosing-between-functions-and-macros.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "Recommendations for Choosing Between Functions and Macros"
3+
description: "Explains the differences between using macros vs functions in the Microsoft C runtime library (CRT)"
34
ms.date: "11/04/2016"
45
f1_keywords: ["c.functions"]
56
helpviewer_keywords: ["functions [CRT], vs. macros", "macros, vs. functions"]
@@ -35,4 +36,5 @@ If you need to choose between a function and a macro implementation of a library
3536

3637
## See also
3738

38-
[CRT Library Features](../c-runtime-library/crt-library-features.md)
39+
[Type-generic math](tgmath.md)\
40+
[CRT Library Features](../c-runtime-library/crt-library-features.md)

0 commit comments

Comments
 (0)