xte::neg()

Defined in header <xte/math/neg.hpp>

Checks whether a number is negative. Uses std::signbit() for floating-point types.
Can be used to avoid warnings enabled by -Wtype-limits.


Definition

inline constexpr auto neg = [][[nodiscard]](xte::is_number auto x) static noexcept -> bool { /* ??? */ };


Example

std::println("{}", xte::neg(-5));
Output:
true
[View in Compiler Explorer]