Zilog Z80380 User Manual
Page 87

UM004001-COR1103
4–23
Run Time Environment
Library Functions
[whitespace] [{ + | -}] [0 [{ x | X }]] [digits]
If base is between 2 and 36, then it is used as the base of the number. If base is 0, the initial
characters of the string pointed to by nptr are used to determine the base. If the first character
is 0 and the second character is not ‘x’ or ‘X’, then the string is interpreted as an octal integer;
otherwise, it is interpreted as a decimal number. If the first character is ‘0’ and the second
character is ‘x’ or ‘X’, then the string is interpreted as a hexadecimal integer. If the first char-
acter is ‘1’ through ‘9’, then the string is interpreted as a decimal integer. The letters ‘a’
through ‘z’ (or ‘A’ through ‘Z’) are assigned the values 10 through 35; only letters whose
assigned values are less than base are permitted.
The strtoul function allows a plus (+) or minus (-) sign prefix; a leading minus sign indicates
that the return value is negated.
Return Value
The strtod function returns the value of the floating-point number, except when the represen-
tation would cause an overflow, in which case they return +/-HUGE_VAL. The functions
return 0 if no conversion could be performed or an underflow occurred.
The strtol function returns the value represented in the string, except when the representation
would cause an overflow, in which case it returns LONG_MAX or LONG_MIN. The func-
tion returns 0 if no conversion could be performed.
The strtoul function returns the converted value, if any. If no conversion can be performed,
the function returns 0. The function returns ULONG_MAX on overflow.
In all these functions, errno is set to ERANGE if overflow or underflow occurs.