diff options
author | David Schultz <das@FreeBSD.org> | 2004-07-18 21:23:39 +0000 |
---|---|---|
committer | David Schultz <das@FreeBSD.org> | 2004-07-18 21:23:39 +0000 |
commit | 39bcea8689cb7cd9a708fdc5dbf616939161e5e5 (patch) | |
tree | eb35ae876a43222fec2d90dbf20674666f760ca7 /lib/libc/alpha | |
parent | aec86de47b916d7e034c05b9e30fb2b8a2c2ffd6 (diff) | |
download | src-39bcea8689cb7cd9a708fdc5dbf616939161e5e5.tar.gz src-39bcea8689cb7cd9a708fdc5dbf616939161e5e5.zip |
Replace seven nominally MD implementations of frexp() that are broken
for subnormals with one implementation that works.
Notes
Notes:
svn path=/head/; revision=132366
Diffstat (limited to 'lib/libc/alpha')
-rw-r--r-- | lib/libc/alpha/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/alpha/gen/frexp.c | 56 |
2 files changed, 1 insertions, 57 deletions
diff --git a/lib/libc/alpha/gen/Makefile.inc b/lib/libc/alpha/gen/Makefile.inc index 11950b2cee37..8f692746cd43 100644 --- a/lib/libc/alpha/gen/Makefile.inc +++ b/lib/libc/alpha/gen/Makefile.inc @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS+= _setjmp.S fabs.S frexp.c infinity.c ldexp.c modf.c setjmp.S +SRCS+= _setjmp.S fabs.S infinity.c ldexp.c modf.c setjmp.S SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ fpsetround.c fpsetsticky.c diff --git a/lib/libc/alpha/gen/frexp.c b/lib/libc/alpha/gen/frexp.c deleted file mode 100644 index 386c36b7aa86..000000000000 --- a/lib/libc/alpha/gen/frexp.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1994, 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - * - * $NetBSD: frexp.c,v 1.1 1995/02/10 17:50:22 cgd Exp $ - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -double -frexp(value, eptr) - double value; - int *eptr; -{ - union doub { - double v; - struct ieee_double s; - } u; - - if (value) { - u.v = value; - *eptr = u.s.dbl_exp - (DBL_EXP_BIAS - 1); - u.s.dbl_exp = DBL_EXP_BIAS - 1; - return(u.v); - } else { - *eptr = 0; - return((double)0); - } -} |