Unverified Commit 0d7ad3d4 authored by Kiriti Ponduri's avatar Kiriti Ponduri Committed by GitHub
Browse files

[libc][math] Qualify nextafter functions to constexpr (#195596)

parent d9c7b669
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ template <typename T, typename U,
                               cpp::is_floating_point_v<U> &&
                               (sizeof(T) <= sizeof(U)),
                           int> = 0>
LIBC_INLINE T nextafter(T from, U to) {
LIBC_INLINE constexpr T nextafter(T from, U to) {
  FPBits<T> from_bits(from);
  if (from_bits.is_nan())
    return from;
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ namespace LIBC_NAMESPACE_DECL {

namespace math {

LIBC_INLINE double nextafter(double x, double y) {
LIBC_INLINE constexpr double nextafter(double x, double y) {
  return fputil::nextafter(x, y);
}

+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ namespace LIBC_NAMESPACE_DECL {

namespace math {

LIBC_INLINE bfloat16 nextafterbf16(bfloat16 x, bfloat16 y) {
LIBC_INLINE constexpr bfloat16 nextafterbf16(bfloat16 x, bfloat16 y) {
  return fputil::nextafter(x, y);
}

+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ namespace LIBC_NAMESPACE_DECL {

namespace math {

LIBC_INLINE float nextafterf(float x, float y) {
LIBC_INLINE constexpr float nextafterf(float x, float y) {
  return fputil::nextafter(x, y);
}

+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ namespace LIBC_NAMESPACE_DECL {

namespace math {

LIBC_INLINE float128 nextafterf128(float128 x, float128 y) {
LIBC_INLINE constexpr float128 nextafterf128(float128 x, float128 y) {
  return fputil::nextafter(x, y);
}

Loading