[libc-commits] [llvm] [libc] [libc][math] Implement nan(f|l) functions (PR #76690)

Nishant Mittal via libc-commits libc-commits at lists.llvm.org
Wed Jan 3 12:13:02 PST 2024


================
@@ -1055,6 +1055,38 @@ hexadecimal_string_to_float(const char *__restrict src,
   return output;
 }
 
+template <class T>
+LIBC_INLINE fputil::FPBits<T> nan_from_ncharseq(const char *__restrict ncharseq,
----------------
nishantwrp wrote:

> The actual returned value doesn't need to be an FPBits object, if we move the conversion to float elsewhere this function only needs to return a uint64_t (and the error).

By `uint64_t` you mean the nan_mantissa?

> The error can be part of a struct return type, similar to str_to_num_result.
Just out of curiosity, what benefit does it have to make it a part of return payload. Won't it be a little faster/efficient to assign it directly to the `error` object we'll be using?


https://github.com/llvm/llvm-project/pull/76690


More information about the libc-commits mailing list