You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/manual/functions.qmd
+20-18Lines changed: 20 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ The following built-in functions are available:
17
17
| COSH(Number) | Hyperbolic cosine of *Number*. |
18
18
| COT(Number) | Cotangent of *Number*. |
19
19
| EXP(Number) | Euler to the power of *Number*. |
20
-
| EVEN(Number) | Returns *Number* rounded up to the nearest even integer.<br>\linebreak *Number* is always rounded away from zero (e.g., `EVEN(-3)` = -4). |
20
+
| EVEN(Number) | Returns *Number* rounded up to the nearest even integer.<br>\linebreak Values are always rounded away from zero (e.g., `EVEN(-3)` = -4). |
21
21
| FAC(Number) | Returns the factorial of *Number*. The factorial of *Number* is equal to 1\*2\*3\*...\**Number*|
22
22
| FACT(Number) | Alias for `FAC()`|
23
23
| FLOOR(Number) | Returns the largest integer not greater than *Number*.<br>\linebreak `FLOOR(-3.2)` = -4<br>\linebreak `FLOOR(3.2)` = 3 |
@@ -32,7 +32,7 @@ The following built-in functions are available:
32
32
| NAN | Returns an invalid value (i.e., Not-a-number). |
33
33
| NCR(Number, NumberChosen) | Alias for `COMBIN()`. |
34
34
| NPR(Number, NumberChosen) | Alias for `PERMUT()`. |
35
-
| ODD(Number) | Returns *Number* rounded up to the nearest odd integer.<br>\linebreak *Number* is always rounded away from zero (e.g., `ODD(-4)` = -5). |
35
+
| ODD(Number) | Returns *Number* rounded up to the nearest odd integer.<br>\linebreak Values are always rounded away from zero (e.g., `ODD(-4)` = -5). |
36
36
| PERMUT(Number, NumberChosen) | Returns the number of permutations for a given number (*NumberChosen*) of items that can be selected *Number* of items. A permutation is any set of items where order is important. (This differs from combinations, where order is not important). |
37
37
| POW(Base, Exponent) | Raises *Base* to any power. For fractional exponents, *Base* must be greater than 0. |
38
38
| POWER(Base, Exponent) | Alias for `POW()`. |
@@ -49,39 +49,41 @@ The following built-in functions are available:
49
49
Table: Math Functions\index{functions!math}
50
50
:::
51
51
52
-
::: {.minipage data-latex="{\textwidth}"}
52
+
{{< pagebreak >}}
53
+
53
54
| Function | Description |
54
55
| :-- | :-- |
55
56
| BITAND(Number1, Number2) | Returns a bitwise 'AND' of two (integral) numbers. (Both numbers must be positive and cannot exceed `(2^48)-1`.) |
56
-
| BITLROTATE8(Number, RotateAmount) | Returns *Number* left rotated left to the most significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak *Number* is rotated as an unsigned 8-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
57
-
| BITLROTATE16(Number, RotateAmount) | Returns *Number* left rotated left to the most significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak *Number* is rotated as an unsigned 16-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
58
-
| BITLROTATE32(Number, RotateAmount) | Returns *Number* left rotated left to the most significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak *Number* is rotated as an unsigned 32-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
59
-
| BITLROTATE64(Number, RotateAmount) | Returns *Number* left rotated left to the most significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak *Number* is rotated as an unsigned 64-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
60
-
| BITLROTATE(Number, RotateAmount) | Returns *Number* left rotated left to the most significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak *Number* is rotated as either a 32- or 64-bit integer (depending on what is supported by the compiler).<br>\linebreak (Only available if compiled as C++20.) |
61
-
| BITLSHIFT(Number, ShiftAmount) | Returns *Number* left shifted by the specified number (*ShiftAmount*) of bits.<br>\linebreak *Number* cannot exceed `(2^48)-1` and *ShiftAmount* cannot exceed `53` (or `63`, if 64-bit is supported). |
57
+
| BITLROTATE8(Number, RotateAmount) | Returns *Number* left rotated left to the most significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak Numbers are rotated as an unsigned 8-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
58
+
| BITLROTATE16(Number, RotateAmount) | Returns *Number* left rotated left to the most significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak Numbers are rotated as an unsigned 16-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
59
+
| BITLROTATE32(Number, RotateAmount) | Returns *Number* left rotated left to the most significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak Numbers are rotated as an unsigned 32-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
60
+
| BITLROTATE64(Number, RotateAmount) | Returns *Number* left rotated left to the most significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak Numbers are rotated as an unsigned 64-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
61
+
| BITLROTATE(Number, RotateAmount) | Returns *Number* left rotated left to the most significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak Numbers are rotated as either a 32- or 64-bit integer (depending on what is supported by the compiler).<br>\linebreak (Only available if compiled as C++20.) |
62
+
| BITLSHIFT(Number, ShiftAmount) | Returns *Number* left shifted by the specified number (*ShiftAmount*) of bits.<br>\linebreak Numbers cannot exceed `(2^48)-1` and *ShiftAmount* cannot exceed `53` (or `63`, if 64-bit is supported). |
62
63
| BITNOT8(Number) | Returns a bitwise 'NOT' of a 8-bit integer. |
63
64
| BITNOT16(Number) | Returns a bitwise 'NOT' of a 16-bit integer. |
64
65
| BITNOT32(Number) | Returns a bitwise 'NOT' of a 32-bit integer. |
65
66
| BITNOT64(Number) | Returns a bitwise 'NOT' of a 64-bit integer (if 64-bit integers are supported). |
66
67
| BITNOT(Number) | Returns a bitwise 'NOT' of a 32- or 64-bit integer (depending on whether 64-bit is supported). |
67
68
| BITOR(Number1, Number2) | Returns a bitwise 'OR' of two (integral) numbers. (Both numbers must be positive and cannot exceed `(2^48)-1`.) |
68
-
| BITRROTATE8(Number, RotateAmount) | Returns *Number* right rotated right to the least significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak *Number* is rotated as an unsigned 8-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
69
-
| BITRROTATE16(Number, RotateAmount) | Returns *Number* right rotated right to the least significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak *Number* is rotated as an unsigned 16-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
70
-
| BITRROTATE32(Number, RotateAmount) | Returns *Number* right rotated right to the least significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak *Number* is rotated as an unsigned 32-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
71
-
| BITRROTATE64(Number, RotateAmount) | Returns *Number* right rotated right to the least significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak *Number* is rotated as an unsigned 64-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
72
-
| BITRROTATE(Number, RotateAmount) | Returns *Number* right rotated right to the least significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak *Number* is rotated as either a 32- or 64-bit integer (depending on what is supported by the compiler).<br>\linebreak (Only available if compiled as C++20.) |
73
-
| BITRSHIFT(Number, ShiftAmount) | Returns *Number* right shifted by the specified number (*ShiftAmount*) of bits.<br>\linebreak *Number* cannot exceed `(2^48)-1` and *ShiftAmount* cannot exceed `53` (or `63`, if 64-bit is supported). |
69
+
| BITRROTATE8(Number, RotateAmount) | Returns *Number* right rotated right to the least significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak Numbers are rotated as an unsigned 8-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
70
+
| BITRROTATE16(Number, RotateAmount) | Returns *Number* right rotated right to the least significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak Numbers are rotated as an unsigned 16-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
71
+
| BITRROTATE32(Number, RotateAmount) | Returns *Number* right rotated right to the least significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak Numbers are rotated as an unsigned 32-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
72
+
| BITRROTATE64(Number, RotateAmount) | Returns *Number* right rotated right to the least significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak Numbers are rotated as an unsigned 64-bit integer.<br>\linebreak (Only available if compiled as C++20.) |
73
+
| BITRROTATE(Number, RotateAmount) | Returns *Number* right rotated right to the least significant bit by the specified number (*RotateAmount*) of bits.<br>\linebreak Numbers are rotated as either a 32- or 64-bit integer (depending on what is supported by the compiler).<br>\linebreak (Only available if compiled as C++20.) |
74
+
| BITRSHIFT(Number, ShiftAmount) | Returns *Number* right shifted by the specified number (*ShiftAmount*) of bits.<br>\linebreak Numbers cannot exceed `(2^48)-1` and *ShiftAmount* cannot exceed `53` (or `63`, if 64-bit is supported). |
74
75
| BITXOR(Number1, Number2) | Returns a bitwise 'XOR' of two (integral) numbers. (Both numbers must be positive and cannot exceed `(2^48)-1`.) |
75
76
| SUPPORTS32BIT() | Returns true if 32-bit integers are supported. This will affect the supported range of values for bitwise operations. |
76
77
| SUPPORTS64BIT() | Returns true if 64-bit integers are supported. This will affect the supported range of values for bitwise operations. |
Copy file name to clipboardExpand all lines: docs/manual/usage.qmd
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,12 @@ The following data types and constants are used throughout *TinyExpr++*:
7
7
`te_parser`: The main class for defining an evaluation engine and solving expressions.
8
8
9
9
`te_type`: The data type for variables, function parameters, and results.
10
-
By default this is `double`, but can be `float` when [`TE_FLOAT`](#te-float) is defined.
10
+
By default this is `double`, but can be `float` (when [`TE_FLOAT`](#te-float) is defined)
11
+
or `long double` (when `TE_LONG_DOUBLE` is defined).
12
+
13
+
If `long double`\index{data types!\texttt{long double}} is in use, then various bitwise functions (`BITNOT()`, `BITRROTATE()`)
14
+
may be able to support 64-bit integers\index{data types!\texttt{64-bit integer}}. This will depend on the compiler used to build the library and can be verified by calling
15
+
`te_parser::supports_64bit()` in your code or `SUPPORTS64BIT()` in an expression at runtime.
11
16
12
17
`te_variable`: A user-defined variable or function that can be embedded into a `te_parser`.
0 commit comments