]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/LibC/Math/s_finite.c
ArmPkg: ArmLib: purge incorrect ArmDrainWriteBuffer () alias
[mirror_edk2.git] / StdLib / LibC / Math / s_finite.c
CommitLineData
2aa62f2b 1/* @(#)s_finite.c 5.1 93/09/24 */\r
2/*\r
3 * ====================================================\r
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\r
5 *\r
6 * Developed at SunPro, a Sun Microsystems, Inc. business.\r
7 * Permission to use, copy, modify, and distribute this\r
8 * software is freely granted, provided that this notice\r
9 * is preserved.\r
10 * ====================================================\r
11 */\r
12#include <LibConfig.h>\r
13#include <sys/EfiCdefs.h>\r
14#if defined(LIBM_SCCS) && !defined(lint)\r
15__RCSID("$NetBSD: s_finite.c,v 1.11 2002/05/26 22:01:55 wiz Exp $");\r
16#endif\r
17\r
18/*\r
19 * finite(x) returns 1 is x is finite, else 0;\r
20 * no branching!\r
21 */\r
22\r
23#include "math.h"\r
24#include "math_private.h"\r
25\r
26int\r
27finite(double x)\r
28{\r
29 int32_t hx;\r
30 GET_HIGH_WORD(hx,x);\r
31 return (int)((u_int32_t)((hx&0x7fffffff)-0x7ff00000)>>31);\r
32}\r