Pointer to the null-terminated string that represents the number to be converted.
2nd Parameter Type : char **
A pointer to a pointer to a null-terminated string. Commonly used in functions like `strtol` and `strtok_r` to store the address of the first invalid character or to maintain state across function calls.
2nd Parameter
Pointer to a character pointer that will store the address of the first invalid character after the number in `nptr`.
Read more about parameters of strtod64 in parameters section
The strtod64function in C language Converts the initial portion of the string to a decimal floating-point number with 64-bit precision.
The strtod64 function converts the initial portion of the string pointed to by nptr to a _Decimal64 value. It follows similar rules to strtod, but produces a decimal floating-point result with higher precision than strtod32. This function is part of the optional decimal floating-point arithmetic support in C.
The strtod64function takes 2
parameters:
•
const char * `nptr`: Pointer to the null-terminated string that represents the number to be converted.
•
char ** `endptr`: Pointer to a character pointer that will store the address of the first invalid character after the number in `nptr`.
Converts the initial portion of the string pointed to by `nptr` to a `_Decimal64` floating-point value. The conversion stops at the first invalid character. If `endptr` is not NULL, it points to the character after the last valid character used in the conversion.
The strtod64 function return value :
Returns the converted _Decimal64 value
If no conversion could be performed, positive or negative zero is returned (depending on the sign of the input)
If the correct value is outside the range of representable values, the function returns the appropriate positive or negative infinity and sets errno to ERANGE
Output
This example demonstrates basic usage of strtod64 to convert a string to a _Decimal64 value, showing its higher precision compared to strtod32.