mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4cd7f3e32 |
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# $Id: GNUmakefile.68k,v 1.5 2004-08-14 08:54:25 obarthel Exp $
|
# $Id: GNUmakefile.68k,v 1.3 2004-08-07 09:15:32 obarthel Exp $
|
||||||
#
|
#
|
||||||
# :ts=8
|
# :ts=8
|
||||||
#
|
#
|
||||||
@@ -458,7 +458,6 @@ MATH_LIB = \
|
|||||||
math_ldexp.o \
|
math_ldexp.o \
|
||||||
math_log.o \
|
math_log.o \
|
||||||
math_log10.o \
|
math_log10.o \
|
||||||
math_logb.o \
|
|
||||||
math_modf.o \
|
math_modf.o \
|
||||||
math_pow.o \
|
math_pow.o \
|
||||||
math_rint.o \
|
math_rint.o \
|
||||||
@@ -699,6 +698,11 @@ STARTUPS := nrcrt0.o nbcrt0.o nr32crt0.o nb32crt0.o ncrt0.o mainnb.o mainb.o mai
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
all: \
|
all: \
|
||||||
|
lib/libm020/libm.a \
|
||||||
|
lib/libm.a \
|
||||||
|
lib/libb/libm020/libm.a \
|
||||||
|
lib/libb/libm.a \
|
||||||
|
lib/libb32/libm020/libm.a \
|
||||||
lib/nrcrt0.o \
|
lib/nrcrt0.o \
|
||||||
lib/nbcrt0.o \
|
lib/nbcrt0.o \
|
||||||
lib/ncrt0.o \
|
lib/ncrt0.o \
|
||||||
@@ -706,12 +710,7 @@ all: \
|
|||||||
lib/n32rcrt0.o \
|
lib/n32rcrt0.o \
|
||||||
lib/mainnb.o \
|
lib/mainnb.o \
|
||||||
lib/mainb.o \
|
lib/mainb.o \
|
||||||
lib/mainb32.o \
|
lib/mainb32.o
|
||||||
lib/libm.a \
|
|
||||||
lib/libm020/libm.a \
|
|
||||||
lib/libb/libm.a \
|
|
||||||
lib/libb/libm020/libm.a \
|
|
||||||
lib/libb32/libm020/libm.a
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# $Id: GNUmakefile.os4,v 1.4 2004-08-12 12:31:15 obarthel Exp $
|
# $Id: GNUmakefile.os4,v 1.3 2004-08-07 09:15:32 obarthel Exp $
|
||||||
#
|
#
|
||||||
# :ts=8
|
# :ts=8
|
||||||
#
|
#
|
||||||
@@ -450,7 +450,6 @@ MATH_LIB = \
|
|||||||
math_ldexp.o \
|
math_ldexp.o \
|
||||||
math_log.o \
|
math_log.o \
|
||||||
math_log10.o \
|
math_log10.o \
|
||||||
math_logb.o \
|
|
||||||
math_modf.o \
|
math_modf.o \
|
||||||
math_pow.o \
|
math_pow.o \
|
||||||
math_rint.o \
|
math_rint.o \
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define VERSION 1
|
#define VERSION 1
|
||||||
#define REVISION 170
|
#define REVISION 169
|
||||||
#define DATE "14.8.2004"
|
#define DATE "8.8.2004"
|
||||||
#define VERS "amiga.lib 1.170"
|
#define VERS "amiga.lib 1.169"
|
||||||
#define VSTRING "amiga.lib 1.170 (14.8.2004)\r\n"
|
#define VSTRING "amiga.lib 1.169 (8.8.2004)\r\n"
|
||||||
#define VERSTAG "\0$VER: amiga.lib 1.170 (14.8.2004)"
|
#define VERSTAG "\0$VER: amiga.lib 1.169 (8.8.2004)"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
170
|
169
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define VERSION 1
|
#define VERSION 1
|
||||||
#define REVISION 170
|
#define REVISION 169
|
||||||
#define DATE "14.8.2004"
|
#define DATE "8.8.2004"
|
||||||
#define VERS "c.lib 1.170"
|
#define VERS "c.lib 1.169"
|
||||||
#define VSTRING "c.lib 1.170 (14.8.2004)\r\n"
|
#define VSTRING "c.lib 1.169 (8.8.2004)\r\n"
|
||||||
#define VERSTAG "\0$VER: c.lib 1.170 (14.8.2004)"
|
#define VERSTAG "\0$VER: c.lib 1.169 (8.8.2004)"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
170
|
169
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define VERSION 1
|
#define VERSION 1
|
||||||
#define REVISION 170
|
#define REVISION 169
|
||||||
#define DATE "14.8.2004"
|
#define DATE "8.8.2004"
|
||||||
#define VERS "debug.lib 1.170"
|
#define VERS "debug.lib 1.169"
|
||||||
#define VSTRING "debug.lib 1.170 (14.8.2004)\r\n"
|
#define VSTRING "debug.lib 1.169 (8.8.2004)\r\n"
|
||||||
#define VERSTAG "\0$VER: debug.lib 1.170 (14.8.2004)"
|
#define VERSTAG "\0$VER: debug.lib 1.169 (8.8.2004)"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
170
|
169
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: math.h,v 1.3 2004-08-12 12:31:29 obarthel Exp $
|
* $Id: math.h,v 1.2 2004-08-07 09:15:33 obarthel Exp $
|
||||||
*
|
*
|
||||||
* :ts=4
|
* :ts=4
|
||||||
*
|
*
|
||||||
@@ -89,7 +89,6 @@ extern double rint(double x);
|
|||||||
extern float rintf(float x);
|
extern float rintf(float x);
|
||||||
extern int isinf(double x);
|
extern int isinf(double x);
|
||||||
extern int isnan(double x);
|
extern int isnan(double x);
|
||||||
extern double logb(double x);
|
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define VERSION 1
|
#define VERSION 1
|
||||||
#define REVISION 170
|
#define REVISION 169
|
||||||
#define DATE "14.8.2004"
|
#define DATE "8.8.2004"
|
||||||
#define VERS "m.lib 1.170"
|
#define VERS "m.lib 1.169"
|
||||||
#define VSTRING "m.lib 1.170 (14.8.2004)\r\n"
|
#define VSTRING "m.lib 1.169 (8.8.2004)\r\n"
|
||||||
#define VERSTAG "\0$VER: m.lib 1.170 (14.8.2004)"
|
#define VERSTAG "\0$VER: m.lib 1.169 (8.8.2004)"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
170
|
169
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define VERSION 1
|
#define VERSION 1
|
||||||
#define REVISION 170
|
#define REVISION 169
|
||||||
#define DATE "14.8.2004"
|
#define DATE "8.8.2004"
|
||||||
#define VERS "m881.lib 1.170"
|
#define VERS "m881.lib 1.169"
|
||||||
#define VSTRING "m881.lib 1.170 (14.8.2004)\r\n"
|
#define VSTRING "m881.lib 1.169 (8.8.2004)\r\n"
|
||||||
#define VERSTAG "\0$VER: m881.lib 1.170 (14.8.2004)"
|
#define VERSTAG "\0$VER: m881.lib 1.169 (8.8.2004)"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
170
|
169
|
||||||
|
|||||||
@@ -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.1.1.1 2004-07-26 16:30:45 obarthel Exp $
|
||||||
*
|
*
|
||||||
* :ts=4
|
* :ts=4
|
||||||
*
|
*
|
||||||
@@ -38,7 +38,6 @@
|
|||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <float.h>
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|||||||
@@ -1,136 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: math_logb.c,v 1.1 2004-08-12 12:31:16 obarthel Exp $
|
|
||||||
*
|
|
||||||
* :ts=4
|
|
||||||
*
|
|
||||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
|
||||||
* Copyright (c) 2002-2004 by Olaf Barthel <olsen@sourcery.han.de>
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* - Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
|
||||||
* may be used to endorse or promote products derived from this
|
|
||||||
* software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* PowerPC math library based in part on work by Sun Microsystems
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _MATH_HEADERS_H
|
|
||||||
#include "math_headers.h"
|
|
||||||
#endif /* _MATH_HEADERS_H */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#if defined(FLOATING_POINT_SUPPORT)
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#if defined(IEEE_FLOATING_POINT_SUPPORT) || defined(M68881_FLOATING_POINT_SUPPORT)
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
INLINE static const double
|
|
||||||
__logb(double x)
|
|
||||||
{
|
|
||||||
double result;
|
|
||||||
|
|
||||||
result = log(x) / log(FLT_RADIX);
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* IEEE_FLOATING_POINT_SUPPORT || M68881_FLOATING_POINT_SUPPORT */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#if defined(PPC_FLOATING_POINT_SUPPORT)
|
|
||||||
|
|
||||||
INLINE static const double
|
|
||||||
__logb(double x)
|
|
||||||
{
|
|
||||||
unsigned int lx,ix;
|
|
||||||
|
|
||||||
EXTRACT_WORDS(ix,lx,x);
|
|
||||||
|
|
||||||
ix &= 0x7fffffff; /* high |x| */
|
|
||||||
if((ix|lx)==0)
|
|
||||||
return -1.0/fabs(x);
|
|
||||||
|
|
||||||
if(ix>=0x7ff00000)
|
|
||||||
return x*x;
|
|
||||||
|
|
||||||
if((ix>>=20)==0) /* IEEE 754 logb */
|
|
||||||
return -1022.0;
|
|
||||||
else
|
|
||||||
return (double) (ix-1023);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* PPC_FLOATING_POINT_SUPPORT */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
double
|
|
||||||
logb(double x)
|
|
||||||
{
|
|
||||||
double result;
|
|
||||||
|
|
||||||
int sign;
|
|
||||||
|
|
||||||
if(x == 0.0)
|
|
||||||
{
|
|
||||||
result = -HUGE_VAL;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isnan(x))
|
|
||||||
{
|
|
||||||
result = x;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
sign = isinf(x);
|
|
||||||
if(sign != 0)
|
|
||||||
{
|
|
||||||
if(sign < 0)
|
|
||||||
result = (-x);
|
|
||||||
else
|
|
||||||
result = x;
|
|
||||||
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = __logb(x);
|
|
||||||
|
|
||||||
out:
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#endif /* FLOATING_POINT_SUPPORT */
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#define VERSION 1
|
#define VERSION 1
|
||||||
#define REVISION 170
|
#define REVISION 169
|
||||||
#define DATE "14.8.2004"
|
#define DATE "8.8.2004"
|
||||||
#define VERS "net.lib 1.170"
|
#define VERS "net.lib 1.169"
|
||||||
#define VSTRING "net.lib 1.170 (14.8.2004)\r\n"
|
#define VSTRING "net.lib 1.169 (8.8.2004)\r\n"
|
||||||
#define VERSTAG "\0$VER: net.lib 1.170 (14.8.2004)"
|
#define VERSTAG "\0$VER: net.lib 1.169 (8.8.2004)"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
170
|
169
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
c.lib 1.170 (14.8.2004)
|
|
||||||
|
|
||||||
- Added "math_logb.c", and it appears to work, too.
|
|
||||||
|
|
||||||
|
|
||||||
c.lib 1.169 (8.8.2004)
|
c.lib 1.169 (8.8.2004)
|
||||||
|
|
||||||
- Since the 'long double' data type is not really supported by the GCC
|
- Since the 'long double' data type is not really supported by the GCC
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# $Id: smakefile,v 1.5 2004-08-12 12:31:27 obarthel Exp $
|
# $Id: smakefile,v 1.4 2004-08-07 09:15:32 obarthel Exp $
|
||||||
#
|
#
|
||||||
# :ts=8
|
# :ts=8
|
||||||
#
|
#
|
||||||
@@ -195,7 +195,6 @@ MATH_OBJ = \
|
|||||||
math_ldexp.o \
|
math_ldexp.o \
|
||||||
math_log.o \
|
math_log.o \
|
||||||
math_log10.o \
|
math_log10.o \
|
||||||
math_logb.o \
|
|
||||||
math_modf.o \
|
math_modf.o \
|
||||||
math_pow.o \
|
math_pow.o \
|
||||||
math_rint.o \
|
math_rint.o \
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define VERSION 1
|
#define VERSION 1
|
||||||
#define REVISION 170
|
#define REVISION 169
|
||||||
#define DATE "14.8.2004"
|
#define DATE "8.8.2004"
|
||||||
#define VERS "stack.lib 1.170"
|
#define VERS "stack.lib 1.169"
|
||||||
#define VSTRING "stack.lib 1.170 (14.8.2004)\r\n"
|
#define VSTRING "stack.lib 1.169 (8.8.2004)\r\n"
|
||||||
#define VERSTAG "\0$VER: stack.lib 1.170 (14.8.2004)"
|
#define VERSTAG "\0$VER: stack.lib 1.169 (8.8.2004)"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
170
|
169
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define VERSION 1
|
#define VERSION 1
|
||||||
#define REVISION 170
|
#define REVISION 169
|
||||||
#define DATE "14.8.2004"
|
#define DATE "8.8.2004"
|
||||||
#define VERS "unix.lib 1.170"
|
#define VERS "unix.lib 1.169"
|
||||||
#define VSTRING "unix.lib 1.170 (14.8.2004)\r\n"
|
#define VSTRING "unix.lib 1.169 (8.8.2004)\r\n"
|
||||||
#define VERSTAG "\0$VER: unix.lib 1.170 (14.8.2004)"
|
#define VERSTAG "\0$VER: unix.lib 1.169 (8.8.2004)"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
170
|
169
|
||||||
|
|||||||
Reference in New Issue
Block a user