llvm/llvm-project

[libc][math] Add missing isnan variants for float16, bfloat16, and float128

Open

#195,400 opened on May 2, 2026

View on GitHub
 (16 comments) (0 reactions) (3 assignees)C++ (10,782 forks)batch import
good first issuelibc

Repository metrics

Stars
 (26,378 stars)
PR merge metrics
 (Avg merge 1d 2h) (1,000 merged PRs in 30d)

Description

The current implementations of isnan are limited to float, double, and long double. We should add support for the remaining types (float16, bfloat16, and float128).

Additionally, the existing implementations currently rely on __builtin_isnan. I think refactoring them to use fputil would be better, especially since issignaling already uses fputil.

Contributor guide