]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/LibC/Math/w_fmod.c
ArmPkg: ArmLib: purge incorrect ArmDrainWriteBuffer () alias
[mirror_edk2.git] / StdLib / LibC / Math / w_fmod.c
CommitLineData
2aa62f2b 1/* @(#)w_fmod.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: w_fmod.c,v 1.9 2002/05/26 22:02:00 wiz Exp $");\r
16#endif\r
17\r
18/*\r
19 * wrapper fmod(x,y)\r
20 */\r
21\r
22#include "math.h"\r
23#include "math_private.h"\r
24\r
25\r
26double\r
27fmod(double x, double y) /* wrapper fmod */\r
28{\r
29#ifdef _IEEE_LIBM\r
30 return __ieee754_fmod(x,y);\r
31#else\r
32 double z;\r
33 z = __ieee754_fmod(x,y);\r
34 if(_LIB_VERSION == _IEEE_ ||isnan(y)||isnan(x)) return z;\r
35 if(y==0.0) {\r
36 return __kernel_standard(x,y,27); /* fmod(x,0) */\r
37 } else\r
38 return z;\r
39#endif\r
40}\r