1*390c8400Smartynas /* $OpenBSD: s_fabsl.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */
2*390c8400Smartynas /*
3*390c8400Smartynas * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
4*390c8400Smartynas *
5*390c8400Smartynas * Permission to use, copy, modify, and distribute this software for any
6*390c8400Smartynas * purpose with or without fee is hereby granted, provided that the above
7*390c8400Smartynas * copyright notice and this permission notice appear in all copies.
8*390c8400Smartynas *
9*390c8400Smartynas * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10*390c8400Smartynas * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*390c8400Smartynas * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12*390c8400Smartynas * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*390c8400Smartynas * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*390c8400Smartynas * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15*390c8400Smartynas * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*390c8400Smartynas */
17*390c8400Smartynas
18*390c8400Smartynas #include <sys/types.h>
19*390c8400Smartynas #include <machine/ieee.h>
20*390c8400Smartynas #include <math.h>
21*390c8400Smartynas
22*390c8400Smartynas long double
fabsl(long double x)23*390c8400Smartynas fabsl(long double x)
24*390c8400Smartynas {
25*390c8400Smartynas struct ieee_ext *p = (struct ieee_ext *)&x;
26*390c8400Smartynas
27*390c8400Smartynas p->ext_sign = 0;
28*390c8400Smartynas
29*390c8400Smartynas return x;
30*390c8400Smartynas }
31