Just some minor cleanup.
This commit is contained in:
parent
ab43bc629f
commit
2b504929fa
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: frexp.c,v 1.1 1995/02/10 17:50:22 cgd Exp $ */
|
||||
/* $NetBSD: frexp.c,v 1.2 1999/03/10 08:15:43 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
@ -45,9 +45,9 @@ frexp(value, eptr)
|
||||
u.v = value;
|
||||
*eptr = u.s.dbl_exp - (DBL_EXP_BIAS - 1);
|
||||
u.s.dbl_exp = DBL_EXP_BIAS - 1;
|
||||
return(u.v);
|
||||
return (u.v);
|
||||
} else {
|
||||
*eptr = 0;
|
||||
return((double)0);
|
||||
return (0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ldexp.c,v 1.1 1995/02/10 17:50:24 cgd Exp $ */
|
||||
/* $NetBSD: ldexp.c,v 1.2 1999/03/10 08:15:43 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
@ -53,7 +53,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
u.v = val;
|
||||
oldexp = u.s.dbl_exp;
|
||||
if (val == 0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
if (val == 0.0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
return (val);
|
||||
|
||||
/*
|
||||
@ -64,7 +64,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
newexp = oldexp + exp;
|
||||
if (newexp >= DBL_EXP_INFNAN) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = DBL_EXP_INFNAN;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -76,7 +76,7 @@ ldexp(val, exp)
|
||||
* (see comments in machine/ieee.h).
|
||||
*/
|
||||
if (newexp <= -DBL_FRACBITS) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = 0;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -88,7 +88,7 @@ ldexp(val, exp)
|
||||
* 2^-2097, so we may have to do this as many as three
|
||||
* steps (not just two, as for positive `exp's below).
|
||||
*/
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
while (exp <= -DBL_EXP_BIAS) {
|
||||
mul.s.dbl_exp = 1;
|
||||
val *= mul.v;
|
||||
@ -116,7 +116,7 @@ ldexp(val, exp)
|
||||
* arithmetic just as for normal `double's.
|
||||
*/
|
||||
mulexp = exp <= DBL_EXP_BIAS ? exp : DBL_EXP_BIAS;
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
mul.s.dbl_exp = mulexp + DBL_EXP_BIAS;
|
||||
val *= mul.v;
|
||||
if (mulexp == exp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: frexp.c,v 1.4 1997/10/13 21:24:25 mark Exp $ */
|
||||
/* $NetBSD: frexp.c,v 1.5 1999/03/10 08:15:43 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -44,13 +44,13 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)frexp.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: frexp.c,v 1.4 1997/10/13 21:24:25 mark Exp $");
|
||||
__RCSID("$NetBSD: frexp.c,v 1.5 1999/03/10 08:15:43 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <machine/ieee.h>
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
* Split the given value into a fraction in the range [0.5, 1.0) and
|
||||
@ -81,6 +81,6 @@ frexp(value, eptr)
|
||||
return (u.v);
|
||||
} else {
|
||||
*eptr = 0;
|
||||
return ((double)0);
|
||||
return (0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ldexp.c,v 1.4 1997/10/13 21:24:15 mark Exp $ */
|
||||
/* $NetBSD: ldexp.c,v 1.5 1999/03/10 08:15:43 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -44,14 +44,14 @@
|
||||
#if 0
|
||||
static const char sccsid[] = "@(#)ldexp.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.4 1997/10/13 21:24:15 mark Exp $");
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.5 1999/03/10 08:15:43 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <machine/ieee.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
* double ldexp(double val, int exp)
|
||||
@ -74,7 +74,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
u.v = val;
|
||||
oldexp = u.s.dbl_exp;
|
||||
if (val == 0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
if (val == 0.0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
return (val);
|
||||
|
||||
/*
|
||||
@ -85,7 +85,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
newexp = oldexp + exp;
|
||||
if (newexp >= DBL_EXP_INFNAN) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = DBL_EXP_INFNAN;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -97,7 +97,7 @@ ldexp(val, exp)
|
||||
* (see comments in machine/ieee.h).
|
||||
*/
|
||||
if (newexp <= -DBL_FRACBITS) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = 0;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -109,7 +109,7 @@ ldexp(val, exp)
|
||||
* 2^-2097, so we may have to do this as many as three
|
||||
* steps (not just two, as for positive `exp's below).
|
||||
*/
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
while (exp <= -DBL_EXP_BIAS) {
|
||||
mul.s.dbl_exp = 1;
|
||||
val *= mul.v;
|
||||
@ -137,7 +137,7 @@ ldexp(val, exp)
|
||||
* arithmetic just as for normal `double's.
|
||||
*/
|
||||
mulexp = exp <= DBL_EXP_BIAS ? exp : DBL_EXP_BIAS;
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
mul.s.dbl_exp = mulexp + DBL_EXP_BIAS;
|
||||
val *= mul.v;
|
||||
if (mulexp == exp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ldexp.c,v 1.5 1998/08/15 09:36:04 mycroft Exp $ */
|
||||
/* $NetBSD: ldexp.c,v 1.6 1999/03/10 08:15:43 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -37,11 +37,12 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.5 1998/08/15 09:36:04 mycroft Exp $");
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.6 1999/03/10 08:15:43 mycroft Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <machine/ieee.h>
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ldexp.c,v 1.3 1997/10/02 21:47:47 is Exp $ */
|
||||
/* $NetBSD: ldexp.c,v 1.4 1999/03/10 08:15:44 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -44,14 +44,14 @@
|
||||
#if 0
|
||||
static const char sccsid[] = "@(#)ldexp.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.3 1997/10/02 21:47:47 is Exp $");
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.4 1999/03/10 08:15:44 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <m68k/ieee.h>
|
||||
#include <machine/ieee.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
* double ldexp(double val, int exp)
|
||||
@ -74,7 +74,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
u.v = val;
|
||||
oldexp = u.s.dbl_exp;
|
||||
if (val == 0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
if (val == 0.0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
return (val);
|
||||
|
||||
/*
|
||||
@ -85,7 +85,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
newexp = oldexp + exp;
|
||||
if (newexp >= DBL_EXP_INFNAN) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = DBL_EXP_INFNAN;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -97,7 +97,7 @@ ldexp(val, exp)
|
||||
* (see comments in machine/ieee.h).
|
||||
*/
|
||||
if (newexp <= -DBL_FRACBITS) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = 0;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -109,7 +109,7 @@ ldexp(val, exp)
|
||||
* 2^-2097, so we may have to do this as many as three
|
||||
* steps (not just two, as for positive `exp's below).
|
||||
*/
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
while (exp <= -DBL_EXP_BIAS) {
|
||||
mul.s.dbl_exp = 1;
|
||||
val *= mul.v;
|
||||
@ -137,7 +137,7 @@ ldexp(val, exp)
|
||||
* arithmetic just as for normal `double's.
|
||||
*/
|
||||
mulexp = exp <= DBL_EXP_BIAS ? exp : DBL_EXP_BIAS;
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
mul.s.dbl_exp = mulexp + DBL_EXP_BIAS;
|
||||
val *= mul.v;
|
||||
if (mulexp == exp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ldexp.c,v 1.2 1997/07/13 18:41:59 christos Exp $ */
|
||||
/* $NetBSD: ldexp.c,v 1.3 1999/03/10 08:15:44 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -44,14 +44,14 @@
|
||||
#if 0
|
||||
static const char sccsid[] = "@(#)ldexp.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.2 1997/07/13 18:41:59 christos Exp $");
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.3 1999/03/10 08:15:44 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <machine/ieee.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
* double ldexp(double val, int exp)
|
||||
@ -74,7 +74,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
u.v = val;
|
||||
oldexp = u.s.dbl_exp;
|
||||
if (val == 0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
if (val == 0.0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
return (val);
|
||||
|
||||
/*
|
||||
@ -85,7 +85,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
newexp = oldexp + exp;
|
||||
if (newexp >= DBL_EXP_INFNAN) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = DBL_EXP_INFNAN;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -97,7 +97,7 @@ ldexp(val, exp)
|
||||
* (see comments in machine/ieee.h).
|
||||
*/
|
||||
if (newexp <= -DBL_FRACBITS) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = 0;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -109,7 +109,7 @@ ldexp(val, exp)
|
||||
* 2^-2097, so we may have to do this as many as three
|
||||
* steps (not just two, as for positive `exp's below).
|
||||
*/
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
while (exp <= -DBL_EXP_BIAS) {
|
||||
mul.s.dbl_exp = 1;
|
||||
val *= mul.v;
|
||||
@ -137,7 +137,7 @@ ldexp(val, exp)
|
||||
* arithmetic just as for normal `double's.
|
||||
*/
|
||||
mulexp = exp <= DBL_EXP_BIAS ? exp : DBL_EXP_BIAS;
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
mul.s.dbl_exp = mulexp + DBL_EXP_BIAS;
|
||||
val *= mul.v;
|
||||
if (mulexp == exp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: frexp.c,v 1.2 1997/07/13 18:42:29 christos Exp $ */
|
||||
/* $NetBSD: frexp.c,v 1.3 1999/03/10 08:15:44 mycroft Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -43,13 +43,13 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)frexp.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: frexp.c,v 1.2 1997/07/13 18:42:29 christos Exp $");
|
||||
__RCSID("$NetBSD: frexp.c,v 1.3 1999/03/10 08:15:44 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <machine/ieee.h>
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
* Split the given value into a fraction in the range [0.5, 1.0) and
|
||||
@ -80,6 +80,6 @@ frexp(value, eptr)
|
||||
return (u.v);
|
||||
} else {
|
||||
*eptr = 0;
|
||||
return ((double)0);
|
||||
return (0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ldexp.c,v 1.2 1997/07/13 18:43:52 christos Exp $ */
|
||||
/* $NetBSD: ldexp.c,v 1.3 1999/03/10 08:15:44 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -44,14 +44,14 @@
|
||||
#if 0
|
||||
static const char sccsid[] = "@(#)ldexp.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.2 1997/07/13 18:43:52 christos Exp $");
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.3 1999/03/10 08:15:44 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <machine/ieee.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
* double ldexp(double val, int exp)
|
||||
@ -74,7 +74,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
u.v = val;
|
||||
oldexp = u.s.dbl_exp;
|
||||
if (val == 0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
if (val == 0.0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
return (val);
|
||||
|
||||
/*
|
||||
@ -85,7 +85,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
newexp = oldexp + exp;
|
||||
if (newexp >= DBL_EXP_INFNAN) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = DBL_EXP_INFNAN;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -97,7 +97,7 @@ ldexp(val, exp)
|
||||
* (see comments in machine/ieee.h).
|
||||
*/
|
||||
if (newexp <= -DBL_FRACBITS) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = 0;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -109,7 +109,7 @@ ldexp(val, exp)
|
||||
* 2^-2097, so we may have to do this as many as three
|
||||
* steps (not just two, as for positive `exp's below).
|
||||
*/
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
while (exp <= -DBL_EXP_BIAS) {
|
||||
mul.s.dbl_exp = 1;
|
||||
val *= mul.v;
|
||||
@ -137,7 +137,7 @@ ldexp(val, exp)
|
||||
* arithmetic just as for normal `double's.
|
||||
*/
|
||||
mulexp = exp <= DBL_EXP_BIAS ? exp : DBL_EXP_BIAS;
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
mul.s.dbl_exp = mulexp + DBL_EXP_BIAS;
|
||||
val *= mul.v;
|
||||
if (mulexp == exp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: frexp.c,v 1.1 1998/09/11 04:56:26 eeh Exp $ */
|
||||
/* $NetBSD: frexp.c,v 1.2 1999/03/10 08:15:44 mycroft Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -43,13 +43,13 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)frexp.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: frexp.c,v 1.1 1998/09/11 04:56:26 eeh Exp $");
|
||||
__RCSID("$NetBSD: frexp.c,v 1.2 1999/03/10 08:15:44 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <machine/ieee.h>
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
* Split the given value into a fraction in the range [0.5, 1.0) and
|
||||
@ -80,6 +80,6 @@ frexp(value, eptr)
|
||||
return (u.v);
|
||||
} else {
|
||||
*eptr = 0;
|
||||
return ((double)0);
|
||||
return (0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ldexp.c,v 1.1 1998/09/11 04:56:27 eeh Exp $ */
|
||||
/* $NetBSD: ldexp.c,v 1.2 1999/03/10 08:15:44 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -44,14 +44,14 @@
|
||||
#if 0
|
||||
static const char sccsid[] = "@(#)ldexp.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.1 1998/09/11 04:56:27 eeh Exp $");
|
||||
__RCSID("$NetBSD: ldexp.c,v 1.2 1999/03/10 08:15:44 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <machine/ieee.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
* double ldexp(double val, int exp)
|
||||
@ -74,7 +74,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
u.v = val;
|
||||
oldexp = u.s.dbl_exp;
|
||||
if (val == 0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
if (val == 0.0 || exp == 0 || oldexp == DBL_EXP_INFNAN)
|
||||
return (val);
|
||||
|
||||
/*
|
||||
@ -85,7 +85,7 @@ ldexp(val, exp)
|
||||
*/
|
||||
newexp = oldexp + exp;
|
||||
if (newexp >= DBL_EXP_INFNAN) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = DBL_EXP_INFNAN;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -97,7 +97,7 @@ ldexp(val, exp)
|
||||
* (see comments in machine/ieee.h).
|
||||
*/
|
||||
if (newexp <= -DBL_FRACBITS) {
|
||||
/* u.s.dbl_sign = val < 0; -- already set */
|
||||
/* u.s.dbl_sign = val < 0.0; -- already set */
|
||||
u.s.dbl_exp = 0;
|
||||
u.s.dbl_frach = u.s.dbl_fracl = 0;
|
||||
errno = ERANGE;
|
||||
@ -109,7 +109,7 @@ ldexp(val, exp)
|
||||
* 2^-2097, so we may have to do this as many as three
|
||||
* steps (not just two, as for positive `exp's below).
|
||||
*/
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
while (exp <= -DBL_EXP_BIAS) {
|
||||
mul.s.dbl_exp = 1;
|
||||
val *= mul.v;
|
||||
@ -137,7 +137,7 @@ ldexp(val, exp)
|
||||
* arithmetic just as for normal `double's.
|
||||
*/
|
||||
mulexp = exp <= DBL_EXP_BIAS ? exp : DBL_EXP_BIAS;
|
||||
mul.v = 0;
|
||||
mul.v = 0.0;
|
||||
mul.s.dbl_exp = mulexp + DBL_EXP_BIAS;
|
||||
val *= mul.v;
|
||||
if (mulexp == exp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: frexp.c,v 1.2 1997/07/13 18:45:44 christos Exp $ */
|
||||
/* $NetBSD: frexp.c,v 1.3 1999/03/10 08:15:44 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)frexp.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: frexp.c,v 1.2 1997/07/13 18:45:44 christos Exp $");
|
||||
__RCSID("$NetBSD: frexp.c,v 1.3 1999/03/10 08:15:44 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -65,9 +65,9 @@ frexp(value, eptr)
|
||||
u.v = value;
|
||||
*eptr = u.s.u_exp - 128;
|
||||
u.s.u_exp = 128;
|
||||
return(u.v);
|
||||
return (u.v);
|
||||
} else {
|
||||
*eptr = 0;
|
||||
return((double)0);
|
||||
return (0.0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user