#include <strformat.h>
|
static double | my_strtod (const char *nptr, char **endptr) |
| Locale‑independent strtod clone. More...
|
|
◆ my_strtod()
static double strformat_ns::misc::my_strtod |
( |
const char * |
nptr, |
|
|
char ** |
endptr |
|
) |
| |
|
inlinestatic |
Locale‑independent strtod
clone.
Parses a floating‑point literal from a C‑string. Leading white‑space, an optional sign, fractional part (with a mandatory '.' as the decimal separator), and an optional exponent (e
/E
) are recognised.
The implementation ignores the current locale; the decimal point must be ‘’.'` and no thousands separators are accepted.
- Parameters
-
nptr | Pointer to NUL‑terminated text to parse. |
endptr | If non‑NULL, receives a pointer to the first character following the parsed number (or nptr on failure). |
- Returns
- The parsed value.
◆ pow10_int()
static double strformat_ns::misc::pow10_int |
( |
int |
exp | ) |
|
|
inlinestaticprivate |
Return 10 raised to an integer power.
A small lookup table is used for the most common range to avoid calling the comparatively expensive pow()
routine. Values outside the table range fall back to pow(10.0, exp)
.
- Parameters
-
exp | Decimal exponent (positive or negative). |
- Returns
- The value 10^exp as a double.
The documentation for this class was generated from the following file: