xref: /llvm-project/libc/src/math/generic/iscanonical.cpp (revision 2b8e81ce919e8db857dc2ba20012e9020af07294)
12d784b19SShourya Goel //===-- Implementation of iscanonical function ----------------------------===//
22d784b19SShourya Goel //
32d784b19SShourya Goel // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42d784b19SShourya Goel // See https://llvm.org/LICENSE.txt for license information.
52d784b19SShourya Goel // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
62d784b19SShourya Goel //
72d784b19SShourya Goel //===----------------------------------------------------------------------===//
82d784b19SShourya Goel 
92d784b19SShourya Goel #include "src/math/iscanonical.h"
102d784b19SShourya Goel #include "src/__support/FPUtil/BasicOperations.h"
112d784b19SShourya Goel #include "src/__support/common.h"
122d784b19SShourya Goel #include "src/__support/macros/config.h"
132d784b19SShourya Goel 
142d784b19SShourya Goel namespace LIBC_NAMESPACE_DECL {
152d784b19SShourya Goel 
16*2b8e81ceSShourya Goel #undef iscanonical
172d784b19SShourya Goel LLVM_LIBC_FUNCTION(int, iscanonical, (double x)) {
182d784b19SShourya Goel   double temp;
19*2b8e81ceSShourya Goel   return fputil::canonicalize(temp, x) == 0;
202d784b19SShourya Goel }
212d784b19SShourya Goel 
222d784b19SShourya Goel } // namespace LIBC_NAMESPACE_DECL
23