String to number conversion implementation. More...
#include "utils/conversion.h"
Functions | |
int32_t | str_to_int (const char *s) |
Convert string to 32-bit signed integer. | |
float | str_to_float (const char *s) |
Convert string to floating-point number. |
String to number conversion implementation.
This file provides the implementation for converting string representations of numbers to their corresponding integer and floating-point values. The functions handle various formats including:
float str_to_float | ( | const char * | s | ) |
Convert string to floating-point number.
Convert a string to a floating-point number.
Parses the input string to construct a float value:
s | Pointer to null-terminated input string |
Example usage:
int32_t str_to_int | ( | const char * | s | ) |
Convert string to 32-bit signed integer.
Convert a string to a 32-bit signed integer.
Parses the input string character by character to construct the integer value:
s | Pointer to null-terminated input string |
Example usage: