1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
-
+
-
+
-
+
-
-
+
+
|
# C11 Feature: More Mathematical Functions
This branch adds more mathematical functions from the set listed [here](https://en.cppreference.com/w/c/numeric/math.html). (To be TIPped some time.)
# The full list
After removing the type-dupes, as Tcl doesn't do those.
## Basic operations
| Name | Description | Tcl notes
--------------------------------
| **fabs** | computes absolute value of a floating-point value (\|x\|) | Existing: `abs()` function
| **fmod** | computes remainder of the floating-point division operation | Existing: `fmod()` function
| **remainder** | computes signed remainder of the floating-point division operation
| **remainder** | computes signed remainder of the floating-point division operation | _This branch_
| **remquo** | computes signed remainder as well as the three last bits of the division operation
| **fma** | computes fused multiply-add operation
| **fma** | computes fused multiply-add operation; (x*y)+z | _This branch_
| **fmax** | determines larger of two floating-point values | Existing: `max()` function
| **fmin** | determines smaller of two floating-point values | Existing: `min()` function
| **fdim** | determines positive difference of two floating-point values (max(0, x-y))
| **fdim** | determines positive difference of two floating-point values (max(0, x-y)) | _This branch_
| **nan** | returns a NaN (not-a-number) | Existing: direct understanding (usually as an error)
## Exponential functions
| Name | Description | Tcl notes
--------------------------------
| **exp** | computes _e_ raised to the given power (_e_<sup>x</sup>) | Existing: `exp()` function
| **exp2** | computes 2 raised to the given power (2<sup>x</sup>) | _This branch_
| **expm1** | computes _e_ raised to the given power, minus one (_e_<sup>x</sup>-1) | _This branch_
| **log** | computes natural (base-_e_) logarithm (ln(x)) | Existing: `log()` function
| **log10** | computes common (base-10) logarithm (log10(x)) | Existing: `log10()` function
| **log2** | computes base-2 logarithm (log2(x)) | _This branch_
| **log10** | computes common (base-10) logarithm (log<sub>10</sub>(x)) | Existing: `log10()` function
| **log2** | computes base-2 logarithm (log<sub>2</sub>(x)) | _This branch_
| **log1p** | computes natural (base-_e_) logarithm of 1 plus the given number (ln(1+x)) | _This branch_
## Power functions
| Name | Description | Tcl notes
--------------------------------
| **pow** | computes a number raised to the given power (x<sup>y</sup>) | Existing: `pow()` function and `**` operator
| **sqrt** | computes square root (√x) | Existing: `sqrt()` function
|
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
-
-
+
+
-
-
-
+
+
+
|
| **round** | rounds to nearest integer, rounding away from zero in halfway cases | Existing: `round()` function
| **nearbyint** | rounds to an integer using current rounding mode
| **rint** | rounds to an integer using current rounding mode with exception if the result differs
## Floating-point manipulation functions
| Name | Description | Tcl notes
--------------------------------
| **frexp** | breaks a number into significand and a power of 2
| **ldexp** | multiplies a number by 2 raised to a power
| **frexp** | breaks a number into significand and a power of 2 | _This branch_
| **ldexp** | multiplies a number by 2 raised to a power | _This branch_
| **modf** | breaks a number into integer and fractional parts
| **scalbn** | computes efficiently a number times `FLT_RADIX` raised to a power
| **ilogb** | extracts exponent of the given number
| **logb** | extracts exponent of the given number
| **nextafter** | determines next representable floating-point value towards the given value
| **copysign** | produces a value with the magnitude of a given value and the sign of another given value
| **logb** | extracts exponent of the given number | _This branch_
| **nextafter** | determines next representable floating-point value towards the given value | _This branch_
| **copysign** | produces a value with the magnitude of a given value and the sign of another given value | _This branch_
## Classification and comparison
| Name | Description | Tcl notes
--------------------------------
| **fpclassify** | classifies the given floating-point value | Existing: `fpclassify` command
| **isfinite** | checks if the given number has finite value | Existing: `isfinite()` function
| **isinf** | checks if the given number is infinite | Existing: `isinf()` function
|