From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/numeric%2Fmath%2Ffloat_t.html | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 devdocs/c/numeric%2Fmath%2Ffloat_t.html (limited to 'devdocs/c/numeric%2Fmath%2Ffloat_t.html') diff --git a/devdocs/c/numeric%2Fmath%2Ffloat_t.html b/devdocs/c/numeric%2Fmath%2Ffloat_t.html new file mode 100644 index 00000000..e9783b11 --- /dev/null +++ b/devdocs/c/numeric%2Fmath%2Ffloat_t.html @@ -0,0 +1,34 @@ +

float_t, double_t

Defined in header <math.h>
typedef /*implementation defined*/ float_t
+
(since C99)
typedef /*implementation defined*/ double_t
+
(since C99)

The types float_t and double_t are floating types at least as wide as float and double, respectively, and such that double_t is at least as wide as float_t. The value of FLT_EVAL_METHOD determines the types of float_t and double_t.

+ + + + + +
FLT_EVAL_METHOD Explanation
0 float_t and double_t are equivalent to float and double, respectively
1 both float_t and double_t are equivalent to double
2 both float_t and double_t are equivalent to long double
other both float_t and double_t are implementation defined

Example

#include <float.h>
+#include <math.h>
+#include <stdio.h>
+ 
+int main(void)
+{
+    printf("%d\n", FLT_EVAL_METHOD);
+    printf("%zu  %zu\n", sizeof(float),sizeof(float_t));
+    printf("%zu  %zu\n", sizeof(double),sizeof(double_t));
+    return 0;
+}

Possible output:

+
0
+4  4
+8  8

References

See also

+
+
(C99)
use of extended precision for intermediate results: 0 not used, 1 double is used instead of float, 2: long double is used
(macro constant)
+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/numeric/math/float_t +

+
-- cgit v1.2.3