22 lines
655 B
C++
22 lines
655 B
C++
//===-- Basic operations on floating point numbers --------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "FloatOperations.h"
|
|
|
|
namespace __llvm_libc {
|
|
namespace fputil {
|
|
|
|
template <typename T,
|
|
cpp::EnableIfType<cpp::IsFloatingPointType<T>::Value, int> = 0>
|
|
static inline T abs(T x) {
|
|
return valueFromBits(absBits(x));
|
|
}
|
|
|
|
} // namespace fputil
|
|
} // namespace __llvm_libc
|