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

c.lib 1.172 (21.8.2004)

- acos() now returns 0 for a domain error.

- asin() now returns 0 for a domain error.

- atan2() now returns 0 for a domain error.

- fmod() now returns x if y == 0 and sets a
  domain error.

- sqrt() now returns 0 for a domain error.

- Added NaN and +Inf constants to the math library
  initialization code which could come in handy later.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14713 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2004-08-21 18:57:41 +00:00
parent de24377581
commit 916dfa3c6a
26 changed files with 138 additions and 74 deletions

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 171
#define DATE "16.8.2004"
#define VERS "amiga.lib 1.171"
#define VSTRING "amiga.lib 1.171 (16.8.2004)\r\n"
#define VERSTAG "\0$VER: amiga.lib 1.171 (16.8.2004)"
#define REVISION 172
#define DATE "21.8.2004"
#define VERS "amiga.lib 1.172"
#define VSTRING "amiga.lib 1.172 (21.8.2004)\r\n"
#define VERSTAG "\0$VER: amiga.lib 1.172 (21.8.2004)"

View File

@ -1 +1 @@
171
172

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 171
#define DATE "16.8.2004"
#define VERS "c.lib 1.171"
#define VSTRING "c.lib 1.171 (16.8.2004)\r\n"
#define VERSTAG "\0$VER: c.lib 1.171 (16.8.2004)"
#define REVISION 172
#define DATE "21.8.2004"
#define VERS "c.lib 1.172"
#define VSTRING "c.lib 1.172 (21.8.2004)\r\n"
#define VERSTAG "\0$VER: c.lib 1.172 (21.8.2004)"

View File

@ -1 +1 @@
171
172

View File

@ -1,3 +1,20 @@
c.lib 1.172 (21.8.2004)
- acos() now returns 0 for a domain error.
- asin() now returns 0 for a domain error.
- atan2() now returns 0 for a domain error.
- fmod() now returns x if y == 0 and sets a
domain error.
- sqrt() now returns 0 for a domain error.
- Added NaN and +Inf constants to the math library
initialization code which could come in handy later.
c.lib 1.171 (16.8.2004)
- Added "math_hypot.c"

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 171
#define DATE "16.8.2004"
#define VERS "debug.lib 1.171"
#define VSTRING "debug.lib 1.171 (16.8.2004)\r\n"
#define VERSTAG "\0$VER: debug.lib 1.171 (16.8.2004)"
#define REVISION 172
#define DATE "21.8.2004"
#define VERS "debug.lib 1.172"
#define VSTRING "debug.lib 1.172 (21.8.2004)\r\n"
#define VERSTAG "\0$VER: debug.lib 1.172 (21.8.2004)"

View File

@ -1 +1 @@
171
172

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 171
#define DATE "16.8.2004"
#define VERS "m.lib 1.171"
#define VSTRING "m.lib 1.171 (16.8.2004)\r\n"
#define VERSTAG "\0$VER: m.lib 1.171 (16.8.2004)"
#define REVISION 172
#define DATE "21.8.2004"
#define VERS "m.lib 1.172"
#define VSTRING "m.lib 1.172 (21.8.2004)\r\n"
#define VERSTAG "\0$VER: m.lib 1.172 (21.8.2004)"

View File

@ -1 +1 @@
171
172

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 171
#define DATE "16.8.2004"
#define VERS "m881.lib 1.171"
#define VSTRING "m881.lib 1.171 (16.8.2004)\r\n"
#define VERSTAG "\0$VER: m881.lib 1.171 (16.8.2004)"
#define REVISION 172
#define DATE "21.8.2004"
#define VERS "m881.lib 1.172"
#define VSTRING "m881.lib 1.172 (21.8.2004)\r\n"
#define VERSTAG "\0$VER: m881.lib 1.172 (21.8.2004)"

View File

@ -1 +1 @@
171
172

View File

@ -1,5 +1,5 @@
/*
* $Id: math_acos.c,v 1.1.1.1 2004-07-26 16:30:37 obarthel Exp $
* $Id: math_acos.c,v 1.2 2004-08-21 18:57:40 obarthel Exp $
*
* :ts=4
*
@ -226,7 +226,7 @@ acos(double x)
}
else
{
result = HUGE_VAL;
result = 0;
errno = EDOM;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: math_asin.c,v 1.1.1.1 2004-07-26 16:30:38 obarthel Exp $
* $Id: math_asin.c,v 1.2 2004-08-21 18:57:40 obarthel Exp $
*
* :ts=4
*
@ -237,7 +237,7 @@ asin(double x)
}
else
{
result = HUGE_VAL;
result = 0;
errno = EDOM;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: math_atan2.c,v 1.1.1.1 2004-07-26 16:30:39 obarthel Exp $
* $Id: math_atan2.c,v 1.2 2004-08-21 18:57:40 obarthel Exp $
*
* :ts=4
*
@ -107,7 +107,7 @@ __atan2(double x,double y)
}
else
{
result = HUGE_VAL;
result = 0;
errno = EDOM;
}
}
@ -186,7 +186,7 @@ __atan2(double x,double y)
}
else
{
result = HUGE_VAL;
result = 0;
errno = EDOM;
}
}
@ -201,9 +201,6 @@ __atan2(double x,double y)
#if defined(PPC_FLOATING_POINT_SUPPORT)
static const double
tiny = 1.0e-300,
zero = 0.0,
@ -326,15 +323,7 @@ atan2(double x,double y)
{
double result;
if(x != 0.0 && y != 0.0)
{
result = __atan2(x,y);
}
else
{
result = HUGE_VAL;
errno = EDOM;
}
result = __atan2(x,y);
return(result);
}

View File

@ -1,5 +1,5 @@
/*
* $Id: math_data.c,v 1.1.1.1 2004-07-26 16:30:40 obarthel Exp $
* $Id: math_data.c,v 1.2 2004-08-21 18:57:40 obarthel Exp $
*
* :ts=4
*
@ -48,3 +48,5 @@ struct Library * MathIeeeDoubTransBase;
/****************************************************************************/
double __huge_val;
double __not_a_number;
double __infinity;

View File

@ -1,5 +1,5 @@
/*
* $Id: math_fmod.c,v 1.1.1.1 2004-07-26 16:30:44 obarthel Exp $
* $Id: math_fmod.c,v 1.2 2004-08-21 18:57:40 obarthel Exp $
*
* :ts=4
*
@ -284,7 +284,7 @@ fmod(double x,double y)
}
else
{
result = HUGE_VAL;
result = x;
errno = EDOM;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: math_headers.h,v 1.2 2004-08-12 12:31:16 obarthel Exp $
* $Id: math_headers.h,v 1.3 2004-08-21 18:57:40 obarthel Exp $
*
* :ts=4
*
@ -165,4 +165,9 @@ extern double __scalbn(double x, int n);
/****************************************************************************/
extern double __not_a_number;
extern double __infinity;
/****************************************************************************/
#endif /* _MATH_HEADERS_H */

View File

@ -1,5 +1,5 @@
/*
* $Id: math_init_exit.c,v 1.2 2004-08-08 10:55:57 obarthel Exp $
* $Id: math_init_exit.c,v 1.3 2004-08-21 18:57:40 obarthel Exp $
*
* :ts=4
*
@ -130,9 +130,23 @@ __math_init(void)
0x7f7fffff
};
static const unsigned long not_a_number[1] =
{
/* Exponent = 255 and fraction != 0.0 */
0x7fffffff
};
static const unsigned long infinity[1] =
{
/* Exponent = 255 and fraction = 0.0 */
0x7f800000
};
assert( sizeof(largest_fp_value) == sizeof(__huge_val) );
memmove((void *)&__huge_val,largest_fp_value,sizeof(largest_fp_value));
memmove((void *)&__not_a_number,not_a_number,sizeof(not_a_number));
memmove((void *)&__infinity,infinity,sizeof(infinity));
}
else if (sizeof(__huge_val) == 8) /* double precision */
{
@ -142,9 +156,23 @@ __math_init(void)
0x7fefffff,0xffffffff
};
static const unsigned long not_a_number[2] =
{
/* Exponent = 2047 and fraction != 0.0 */
0x7fffffff,0xffffffff
};
static const unsigned long infinity[2] =
{
/* Exponent = 2047 and fraction = 0.0 */
0x7ff00000,0x00000000
};
assert( sizeof(largest_fp_value) == sizeof(__huge_val) );
memmove((void *)&__huge_val,largest_fp_value,sizeof(largest_fp_value));
memmove((void *)&__not_a_number,not_a_number,sizeof(not_a_number));
memmove((void *)&__infinity,infinity,sizeof(infinity));
}
#if defined(USE_LONG_DOUBLE)
else if (sizeof(__huge_val) == 12) /* extended precision */
@ -155,9 +183,23 @@ __math_init(void)
0x7ffe0000,0xffffffff,0xffffffff
};
static const unsigned long not_a_number[3] =
{
/* Exponent = 32767 and fraction != 0.0 */
0x7fff0000,0xffffffff,0xffffffff
};
static const unsigned long infinity[3] =
{
/* Exponent = 32767 and fraction = 0.0 */
0x7fff0000,0x00000000,0x00000000
};
assert( sizeof(largest_fp_value) == sizeof(__huge_val) );
memmove((void *)&__huge_val,largest_fp_value,sizeof(largest_fp_value));
memmove((void *)&__not_a_number,not_a_number,sizeof(not_a_number));
memmove((void *)&__infinity,infinity,sizeof(infinity));
}
#endif /* USE_LONG_DOUBLE */

View File

@ -1,5 +1,5 @@
/*
* $Id: math_sqrt.c,v 1.1.1.1 2004-07-26 16:30:53 obarthel Exp $
* $Id: math_sqrt.c,v 1.2 2004-08-21 18:57:40 obarthel Exp $
*
* :ts=4
*
@ -251,7 +251,7 @@ sqrt(double x)
}
else
{
result = HUGE_VAL;
result = 0;
errno = EDOM;
}

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 171
#define DATE "16.8.2004"
#define VERS "net.lib 1.171"
#define VSTRING "net.lib 1.171 (16.8.2004)\r\n"
#define VERSTAG "\0$VER: net.lib 1.171 (16.8.2004)"
#define REVISION 172
#define DATE "21.8.2004"
#define VERS "net.lib 1.172"
#define VSTRING "net.lib 1.172 (21.8.2004)\r\n"
#define VERSTAG "\0$VER: net.lib 1.172 (21.8.2004)"

View File

@ -1 +1 @@
171
172

View File

@ -1,3 +1,12 @@
c.lib 1.172 (21.8.2004)
- Changed the values which the acos(), asin(), atan2(), fmod()
and sqrt() functions return when they find that their parameters
are invalid.
- The atan2() function failed to perform a correct parameter check.
c.lib 1.171 (16.8.2004)
- Added hypot()

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 171
#define DATE "16.8.2004"
#define VERS "stack.lib 1.171"
#define VSTRING "stack.lib 1.171 (16.8.2004)\r\n"
#define VERSTAG "\0$VER: stack.lib 1.171 (16.8.2004)"
#define REVISION 172
#define DATE "21.8.2004"
#define VERS "stack.lib 1.172"
#define VSTRING "stack.lib 1.172 (21.8.2004)\r\n"
#define VERSTAG "\0$VER: stack.lib 1.172 (21.8.2004)"

View File

@ -1 +1 @@
171
172

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 171
#define DATE "16.8.2004"
#define VERS "unix.lib 1.171"
#define VSTRING "unix.lib 1.171 (16.8.2004)\r\n"
#define VERSTAG "\0$VER: unix.lib 1.171 (16.8.2004)"
#define REVISION 172
#define DATE "21.8.2004"
#define VERS "unix.lib 1.172"
#define VSTRING "unix.lib 1.172 (21.8.2004)\r\n"
#define VERSTAG "\0$VER: unix.lib 1.172 (21.8.2004)"

View File

@ -1 +1 @@
171
172