Talk:cpp/string/byte/strtof

Add
On success, these functions return the value corresponding to the contents of.

On failure, errno_macros gets set to a non- value and either or ±huge_val (according to the sign of the value) is returned.

The code example demonstrates checking the value of, but the reasoning behind it is not explained.


 * This need to be incorporated in the page, but in the meantime, the C11 standard here says "If the correct value overflows and default rounding is in effect ... the value of the macro erange is stored in errno. If the result underflows ... whether errno acquires the value erange is implementation-defined" --Ybab321 (talk) 14:39, 22 March 2021 (PDT)


 * For C functions it's also generally useful to mention how POSIX specifies errno (here: ERANGE for both overflow and underflow and EINVAL when it couldn't convert anything) --Cubbi (talk) 10:48, 23 March 2021 (PDT)