Float removes 'E' to prevent scientific notation interpretation
| 255 | |
| 256 | // Float removes 'E' to prevent scientific notation interpretation |
| 257 | static float value_float() { |
| 258 | if (!value_ptr) return 0; |
| 259 | char *e = value_ptr; |
| 260 | for (;;) { |
| 261 | const char c = *e; |
| 262 | if (c == '\0' || c == ' ') break; |
| 263 | if (c == 'E' || c == 'e' || c == 'X' || c == 'x') { |
| 264 | *e = '\0'; |
| 265 | const float ret = strtof(value_ptr, nullptr); |
| 266 | *e = c; |
| 267 | return ret; |
| 268 | } |
| 269 | ++e; |
| 270 | } |
| 271 | return strtof(value_ptr, nullptr); |
| 272 | } |
| 273 | |
| 274 | // Code value as a long or ulong |
| 275 | static int32_t value_long() { return value_ptr ? strtol(value_ptr, nullptr, 10) : 0L; } |
no outgoing calls
no test coverage detected