1//===----------------------------------------------------------------------===//
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/// \file
10/// Implementation of the float128 scalbln function.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_SCALBLNF128_H
15#define LLVM_LIBC_SRC___SUPPORT_MATH_SCALBLNF128_H
16
17#include "hdr/float_macros.h"
18#include "src/__support/FPUtil/ManipulationFunctions.h"
19#include "src/__support/FPUtil/float128.h"
20#include "src/__support/macros/config.h"
21
22#if FLT_RADIX != 2
23#error "FLT_RADIX != 2 is not supported."
24#endif
25
26namespace LIBC_NAMESPACE_DECL {
27namespace math {
28
29using LIBC_NAMESPACE::fputil::Float128;
30
31LIBC_INLINE constexpr Float128 scalblnf128(Float128 x, long n) {
32 return fputil::ldexp(x, exp: n);
33}
34
35} // namespace math
36} // namespace LIBC_NAMESPACE_DECL
37
38#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SCALBLNF128_H
39