1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Added a couple of (float) casts.

- Fixed isblank() to compile properly.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14957 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-05-29 08:19:36 +00:00
parent a03ced93b0
commit fb4dae84aa
6 changed files with 22 additions and 22 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: ctype_isblank.c,v 1.1 2005-05-11 20:15:25 obarthel Exp $
* $Id: ctype_isblank.c,v 1.2 2005-05-29 08:19:36 obarthel Exp $
*
* :ts=4
*
@ -37,7 +37,7 @@
/****************************************************************************/
#undef isspace
#undef isblank
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: math_nextafterf.c,v 1.1 2005-05-12 13:21:43 obarthel Exp $
* $Id: math_nextafterf.c,v 1.2 2005-05-29 08:19:36 obarthel Exp $
*
* :ts=4
*
@ -62,15 +62,15 @@ nextafterf(float x, float y)
ix = hx&0x7fffffff; /* |x| */
iy = hy&0x7fffffff; /* |y| */
if((ix>0x7f800000) || /* x is nan */
(iy>0x7f800000)) /* y is nan */
return x+y;
if((ix>0x7f800000) || /* x is nan */
(iy>0x7f800000)) /* y is nan */
return (float)(x+y);
if(x==y) return x; /* x=y, return x */
if(ix==0) { /* x == 0 */
SET_FLOAT_WORD(x,(hy&0x80000000U)|1);/* return +-minsubnormal */
y = x*x;
if(y==x) return y; else return x; /* raise underflow flag */
}
}
if(hx>=0) { /* x > 0 */
if(hx>hy) { /* x > y, x -= ulp */
hx -= 1;
@ -85,7 +85,7 @@ nextafterf(float x, float y)
}
}
hy = hx&0x7f800000;
if(hy>=0x7f800000) return x+x; /* overflow */
if(hy>=0x7f800000) return (float)(x+x); /* overflow */
if(hy<0x00800000) { /* underflow */
y = x*x;
if(y!=x) { /* raise underflow flag */

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_vfprintf.c,v 1.17 2005-05-12 14:42:32 obarthel Exp $
* $Id: stdio_vfprintf.c,v 1.18 2005-05-29 08:19:36 obarthel Exp $
*
* :ts=4
*
@ -89,7 +89,7 @@ get_num_leading_digits(__long_double_t v,int radix)
/* For some reason log() can crash on GCC 68k... */
#if (!defined(__GNUC__) || defined(__PPC__))
{
num_digits = 1 + floor(log(v) / log(radix));
num_digits = 1 + floor(log(v) / log((double)radix));
}
#else
{
@ -866,11 +866,11 @@ vfprintf(FILE * stream,const char * format, va_list arg)
roundoff_position = max_digits;
if(roundoff_position >= 0)
roundoff_fudge = pow(radix,(double)(roundoff_position + 1));
roundoff_fudge = pow((double)radix,(double)(roundoff_position + 1));
}
else
{
roundoff_fudge = pow(radix,(double)(precision + 1));
roundoff_fudge = pow((double)radix,(double)(precision + 1));
}
if(roundoff_fudge > 0.0)
@ -936,7 +936,7 @@ vfprintf(FILE * stream,const char * format, va_list arg)
simply scale the value without any loss of
precision (we just change the floating point
exponent). */
v /= pow(radix,(double)num_leading_digits);
v /= pow((double)radix,(double)num_leading_digits);
for(i = 0 ; (max_digits != 0) && (i < num_leading_digits) && (output_buffer < buffer_stop) ; i++)
{

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_vfscanf.c,v 1.15 2005-05-14 10:52:31 obarthel Exp $
* $Id: stdio_vfscanf.c,v 1.16 2005-05-29 08:19:36 obarthel Exp $
*
* :ts=4
*
@ -1107,14 +1107,14 @@ vfscanf(FILE *stream, const char *format, va_list arg)
double divisor;
/* A negative exponent means division. */
divisor = pow(radix,(double)exponent);
divisor = pow((double)radix,(double)exponent);
if(divisor != 0.0)
sum = sum / divisor;
}
else
{
/* A positive exponent means multiplication. */
new_sum = sum * pow(radix,(double)exponent);
new_sum = sum * pow((double)radix,(double)exponent);
if(new_sum >= sum)
sum = new_sum;
else

View File

@ -1,5 +1,5 @@
/*
* $Id: stdlib_strtod.c,v 1.7 2005-05-14 10:52:31 obarthel Exp $
* $Id: stdlib_strtod.c,v 1.8 2005-05-29 08:19:36 obarthel Exp $
*
* :ts=4
*
@ -326,7 +326,7 @@ strtod(const char *str, char ** ptr)
double divisor;
/* A negative exponent means division. */
divisor = pow(radix,(double)exponent);
divisor = pow((double)radix,(double)exponent);
if(divisor != 0.0)
{
new_sum = sum / divisor;
@ -343,7 +343,7 @@ strtod(const char *str, char ** ptr)
else
{
/* A positive exponent means multiplication. */
new_sum = sum * pow(radix,(double)exponent);
new_sum = sum * pow((double)radix,(double)exponent);
if(new_sum < sum)
error = ERANGE;
else

View File

@ -1,5 +1,5 @@
/*
* $Id: stdlib_strtof.c,v 1.5 2005-05-14 10:52:31 obarthel Exp $
* $Id: stdlib_strtof.c,v 1.6 2005-05-29 08:19:36 obarthel Exp $
*
* :ts=4
*
@ -326,7 +326,7 @@ strtof(const char *str, char ** ptr)
float divisor;
/* A negative exponent means division. */
divisor = pow(radix,(float)exponent);
divisor = pow((double)radix,(float)exponent);
if(divisor != 0.0)
{
new_sum = sum / divisor;
@ -343,7 +343,7 @@ strtof(const char *str, char ** ptr)
else
{
/* A positive exponent means multiplication. */
new_sum = sum * pow(radix,(float)exponent);
new_sum = sum * pow((double)radix,(float)exponent);
if(new_sum < sum)
error = ERANGE;
else