1//===-- Implementation header for nexttowardf16 -----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_NEXTTOWARDF16_H
10#define LLVM_LIBC_SRC___SUPPORT_MATH_NEXTTOWARDF16_H
11
12#include "include/llvm-libc-macros/float16-macros.h"
13
14#ifdef LIBC_TYPES_HAS_FLOAT16
15
16#include "src/__support/FPUtil/ManipulationFunctions.h"
17#include "src/__support/macros/config.h"
18
19namespace LIBC_NAMESPACE_DECL {
20
21namespace math {
22
23LIBC_INLINE float16 nexttowardf16(float16 x, long double y) {
24 // We can reuse the nextafter implementation because the internal nextafter is
25 // templated on the types of the arguments.
26 return fputil::nextafter(from: x, to: y);
27}
28
29} // namespace math
30} // namespace LIBC_NAMESPACE_DECL
31
32#endif // LIBC_TYPES_HAS_FLOAT16
33
34#endif // LLVM_LIBC_SRC___SUPPORT_MATH_NEXTTOWARDF16_H
35