std1.0.0-beta-7 SafeC docs

Module convert

#include <std/convert.h> source

Type conversions (C11/C17 string ↔ number) All parse functions set *ok = 1 on success, 0 on failure (NULL ok is safe).

Functions

str_to_int
str_to_uintParse an unsigned decimal integer.
str_to_hexParse a hex integer (with or without "0x" prefix).
str_to_floatParse a floating-point number.
int_to_str
uint_to_str
float_to_str
ll_to_intSafe narrowing: return 1 and set *out if v fits in an int, else 0.
float_clamp_to_llClamp a double to [min, max], then round to nearest long long.
str_is_intReturn 1 if the string is a valid decimal integer representation.
str_is_floatReturn 1 if the string is a valid floating-point representation.