ZstrToF64
Description
Parse a decimal floating-point value. Accepts [+-]?digits(.digits)?([eE][+-]?digits)?. Used by JSON / KvConfig numeric values where bit-exactness on long mantissas is not required.
Success
Returns the parsed value as f64.
Failure
Returns 0.0 when no digits are present.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
ArgParse.c:117:
return false;
Zstr end = NULL;
f64 v = ZstrToF64(s, &end);
if (!end || end == s || *end != '\0')
return false;- In
Zstr.c:253:
}
f64 ZstrToF64(Zstr s, Zstr *endptr) {
if (!s) {
if (endptr)- In
KvConfig.c:69:
}
parsed = ZstrToF64(StrBegin(value), &endptr);
if (!endptr || endptr == StrBegin(value) || *endptr != '\0') {- In
JSON.c:409:
Zstr end = NULL;
if (is_flt) {
num->f = ZstrToF64(StrBegin(&ns), &end);
} else {
num->i = ZstrToI64(StrBegin(&ns), &end);
Last updated on