Mistake on this page? Email us
Integer length calculator

Files

file  integer_length.h
 Edge common integer handling functions.
 

Functions

uint16_t edge_int_length (uint32_t value)
 Return the length of the integer in characters. This function calculates the needed space of characters to represent the integer argument. More...
 
int edge_str_to_uint16_t (const char *str, uint16_t *result)
 Convert the string to uin16_t. More...
 

Detailed Description

Function Documentation

uint16_t edge_int_length ( uint32_t  value)

Return the length of the integer in characters. This function calculates the needed space of characters to represent the integer argument.

Parameters
valueThe value to calculate the length as a characters.
Returns
The length as characters.
int edge_str_to_uint16_t ( const char *  str,
uint16_t *  result 
)

Convert the string to uin16_t.

Parameters
strString to convert. String must be NUL-terminated.
resultThe pointer where to store the result.
Returns
0 if conversion succeeded.
1 if an error occured when converting str to uint16_t.