[libc-commits] [libc] [libc] Provide isnan, isnanf and isnanl functions (PR #96008)

via libc-commits libc-commits at lists.llvm.org
Thu Jun 20 08:57:13 PDT 2024


enh-google wrote:

> `isnan` is generally a macro or a function? That needs to be explored more carefully I think.

a macro, because realistically you want this to just be an inlined instruction or two via `__builtin_isnan()`. the c standard even explicitly says "7.12.3.5 The isnan macro" :-)

(callers that want the function [on systems where it exists] need to use the `(isnan)` trick. bionic and glibc do both provide a real function in addition to the macro, but iOS/macOS and musl don't.)

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


More information about the libc-commits mailing list