/* e_remainderf.c -- float version of e_remainder.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if defined(LIBM_SCCS) && !defined(lint)
static char rcsid[] = "$Id: e_remainderf.c,v 1.3 1994/09/22 16:40:06 jtc Exp $";
#endif
#include "math.h"
#include "math_private.h"
#ifdef __STDC__
static const float zero = 0.0;
#else
static float zero = 0.0;
#endif
#ifdef __STDC__
float __ieee754_remainderf(float x, float p)
#else
float __ieee754_remainderf(x,p)
float x,p;
#endif
{
int32_t hx,hp;
u_int32_t sx;
float p_half;
GET_FLOAT_WORD(hx,x);
GET_FLOAT_WORD(hp,p);
sx = hx&0x80000000;
hp &= 0x7fffffff;
hx &= 0x7fffffff;
/* purge off exception values */
if(hp==0) return (x*p)/(x*p); /* p = 0 */
if((hx>=0x7f800000)|| /* x not finite */
((hp>0x7f800000))) /* p is NaN */
return (x*p)/(x*p);
if (hp<=0x7effffff) x = __ieee754_fmodf(x,p+p); /* now x < 2p */
if ((hx-hp)==0) return zero*x;
x = fabsf(x);
p = fabsf(p);
if (hp<0x01000000) {
if(x+x>p) {
x-=p;
if(x+x>=p) x -= p;
}
} else {
p_half = (float)0.5*p;
if(x>p_half) {
x-=p;
if(x>=p_half) x -= p;
}
}
GET_FLOAT_WORD(hx,x);
SET_FLOAT_WORD(x,hx^sx);
return x;
}
?id=8a388d3ec5e00b6871cec94dea8be89818cb043e'>diff
|
| Age | Commit message (Expand) | Author |
| 2013-10-05 | Fixed spelling of 'appeared'. | ast |
| 2013-09-14 | Add needed sys/stat.h include for utimens functions. | njoly |
| 2013-07-29 | Add utimensat(2) specific errors. | njoly |
| 2013-03-08 | PR/47631: NAKAJIMA Yoshihiro | christos |
| 2013-01-13 | Revert defective O_SEARCH implementation committed by manu@ along with | dholland |
| 2012-12-01 | Bump date. New sentence, new line. Wording/articles. | wiz |
| 2012-12-01 | Remove trailing whitespace. | wiz |
| 2012-11-18 | Add most system calls for POSIX extended API set, part 2, with test cases: | manu |
| 2012-11-04 | Bump date for previous. Grammar fix. | wiz |
| 2012-11-03 | add utimens and lutimens wrappers using utimensat. | christos |
| 2011-10-25 | Fix typo reported by Henning Petersen in PR 45515. | wiz |
| 2011-08-22 | Fix the name of syscall which takes timespec as argument. | enami |
| 2011-08-17 | Remove trailing whitespace. Bump date for previous. | wiz |
| 2011-08-17 | Add futimens(2) and part of utimnsat(2) | manu |
| 2010-04-29 | Fix the standards: utimes(2) is still in SUSv4, although marked as legacy. | jruoho |
| 2010-04-29 | Sort errors. | wiz |
| 2010-04-29 | Note that utimes(2) no longer enjoys the blessing of POSIX. | jruoho |
| 2008-06-17 | PR/38942: Pedro F. Giffuni: Mention that utimes now supports setting of | christos |
| 2004-05-13 | \- is a minus, not -. | wiz |
| 2004-04-27 | POSIX-2001: Add restrict keywords to gettimeofday(2) and setitimer(2); | kleink |
| 2003-08-07 | Move UCB-licensed code from 4-clause to 3-clause licence. | agc |
| 2003-04-16 | Use | wiz |
| 2003-01-18 | Merge the nathanw_sa branch. | thorpej |
| 2002-02-08 | Generate <>& symbolically. I'm avoiding .../dist/... directories for now. | ross |
| 2001-09-16 | Boring whitespace fixes. | wiz |
| 1999-12-02 | Add a LIBRARY section to system call manual pages. While it's clear that the | kleink |
| 1999-09-26 | xref symlink(7) | jdolecek |
| 1999-03-22 | Last of the .Os cleanups. .Os is defined in the tmac.doc-common file, | garbled |
| 1997-10-11 | - Don't use captial letter for function name or function args even if | enami |
| 1997-10-06 | Acutally, lchmod, lchown and lutimes may set errno to ELOOP. | enami |
| 1997-10-06 | Add C library interface for new system call lchmod, lchown and lutimes. | enami |
| 1996-04-23 | Document futimes(). | mycroft |
| 1995-07-12 | fix pr 1214 slightly differently. i _didn't_ use the .Fa macro to | cgd |
| 1995-02-27 | merge with lite, keeping most local changes. clean up Ids | cgd |