1e334ea2eSDag-Erling Smørgrav /*-
2*5e53a4f9SPedro F. Giffuni * SPDX-License-Identifier: BSD-3-Clause
3*5e53a4f9SPedro F. Giffuni *
4084f6795SDag-Erling Smørgrav * Copyright (c) 2003 Dag-Erling Smørgrav
5e334ea2eSDag-Erling Smørgrav * All rights reserved.
6e334ea2eSDag-Erling Smørgrav *
7e334ea2eSDag-Erling Smørgrav * Redistribution and use in source and binary forms, with or without
8e334ea2eSDag-Erling Smørgrav * modification, are permitted provided that the following conditions
9e334ea2eSDag-Erling Smørgrav * are met:
10e334ea2eSDag-Erling Smørgrav * 1. Redistributions of source code must retain the above copyright
11e334ea2eSDag-Erling Smørgrav * notice, this list of conditions and the following disclaimer
12e334ea2eSDag-Erling Smørgrav * in this position and unchanged.
13e334ea2eSDag-Erling Smørgrav * 2. Redistributions in binary form must reproduce the above copyright
14e334ea2eSDag-Erling Smørgrav * notice, this list of conditions and the following disclaimer in the
15e334ea2eSDag-Erling Smørgrav * documentation and/or other materials provided with the distribution.
16e334ea2eSDag-Erling Smørgrav * 3. The name of the author may not be used to endorse or promote products
17e334ea2eSDag-Erling Smørgrav * derived from this software without specific prior written permission.
18e334ea2eSDag-Erling Smørgrav *
19e334ea2eSDag-Erling Smørgrav * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20e334ea2eSDag-Erling Smørgrav * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21e334ea2eSDag-Erling Smørgrav * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22e334ea2eSDag-Erling Smørgrav * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23e334ea2eSDag-Erling Smørgrav * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24e334ea2eSDag-Erling Smørgrav * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25e334ea2eSDag-Erling Smørgrav * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26e334ea2eSDag-Erling Smørgrav * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27e334ea2eSDag-Erling Smørgrav * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28e334ea2eSDag-Erling Smørgrav * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29e334ea2eSDag-Erling Smørgrav */
30e334ea2eSDag-Erling Smørgrav
31e334ea2eSDag-Erling Smørgrav #include <math.h>
32e334ea2eSDag-Erling Smørgrav
33e334ea2eSDag-Erling Smørgrav #include "fpmath.h"
34e334ea2eSDag-Erling Smørgrav
35e334ea2eSDag-Erling Smørgrav long double
fabsl(long double x)36e334ea2eSDag-Erling Smørgrav fabsl(long double x)
37e334ea2eSDag-Erling Smørgrav {
382a063d30SDag-Erling Smørgrav union IEEEl2bits u;
392a063d30SDag-Erling Smørgrav
402a063d30SDag-Erling Smørgrav u.e = x;
412a063d30SDag-Erling Smørgrav u.bits.sign = 0;
422a063d30SDag-Erling Smørgrav return (u.e);
43e334ea2eSDag-Erling Smørgrav }
44