| 1 | //===-- Extended-precision atan2 function ---------------------------------===// |
| 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 | #include "src/math/atan2l.h" |
| 10 | #include "src/__support/common.h" |
| 11 | #include "src/__support/macros/properties/types.h" |
| 12 | #include "src/math/atan2.h" |
| 13 | |
| 14 | namespace LIBC_NAMESPACE_DECL { |
| 15 | |
| 16 | // TODO: Implement this for extended precision. |
| 17 | LLVM_LIBC_FUNCTION(long double, atan2l, (long double y, long double x)) { |
| 18 | #if defined(LIBC_TYPES_LONG_DOUBLE_IS_FLOAT64) |
| 19 | return static_cast<long double>( |
| 20 | atan2(static_cast<double>(y), static_cast<double>(x))); |
| 21 | #else |
| 22 | #error "Extended precision is not yet supported" |
| 23 | #endif |
| 24 | } |
| 25 | |
| 26 | } // namespace LIBC_NAMESPACE_DECL |
| 27 | |