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