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

- Implemented exp2()/exp2f() and log2()/log2f() as suggested by

Henning Nielsen Lund. Thank you very much!


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14988 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-06-26 09:06:12 +00:00
parent ae1ac21c71
commit 17e3b3b0e2
10 changed files with 114 additions and 102 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.68k,v 1.62 2005-06-20 07:43:59 obarthel Exp $
# $Id: GNUmakefile.68k,v 1.63 2005-06-26 09:06:09 obarthel Exp $
#
# :ts=8
#
@ -566,6 +566,8 @@ MATH_LIB = \
math_erff.o \
math_exp.o \
math_expf.o \
math_exp2.o \
math_exp2f.o \
math_expm1.o \
math_expm1f.o \
math_fabs.o \
@ -596,6 +598,8 @@ MATH_LIB = \
math_lgamma.o \
math_lgammaf.o \
math_log.o \
math_log2.o \
math_log2f.o \
math_log10.o \
math_log10f.o \
math_log1p.o \

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.os4,v 1.68 2005-06-20 07:43:59 obarthel Exp $
# $Id: GNUmakefile.os4,v 1.69 2005-06-26 09:06:10 obarthel Exp $
#
# :ts=8
#
@ -580,6 +580,8 @@ MATH_LIB = \
math_erff.o \
math_exp.o \
math_expf.o \
math_exp2.o \
math_expf2.o \
math_expm1.o \
math_expm1f.o \
math_fabs.o \
@ -616,6 +618,8 @@ MATH_LIB = \
math_lgamma.o \
math_lgammaf.o \
math_log.o \
math_log2.o \
math_log2f.o \
math_log10.o \
math_log10f.o \
math_log1p.o \

View File

@ -1,12 +1,8 @@
C99 math functions:
(functions generally missing, including their "float" counterparts)
exp2
exp2f
fma
fmaf
log2
log2f
lrint
lrintf
lround

View File

@ -13,6 +13,10 @@
- lstat would overwrite the name parameter via ReadLink(..., name, ...)
instead of ReadLink(..., new_name, ...) <tfrieden>
- Implemented exp2()/exp2f() and log2()/log2f() as suggested by
Henning Nielsen Lund. Thank you very much!
c.lib 1.193 (4.6.2005)

View File

@ -1,83 +1,83 @@
/*
* $Id: getopt.h,v 1.1 2005-06-14 15:22:56 tfrieden Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2005 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.
*/
#ifndef _GETOPT_H
#define _GETOPT_H
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/
#include <unistd.h>
/****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/****************************************************************************/
#define no_argument 0
#define required_argument 1
#define optional_argument 2
struct option
{
const char * name;
int has_arg;
int * flag;
int val;
};
/****************************************************************************/
extern int getopt_long(int argc, const char **argv, const char *optstring,
const struct option *longopts, int *longindex);
/*extern int getopt_long_only(int argc, const char **argv, const char *optstring,
const struct option *longopts, int *longindex);
*/
extern int optreset;
/****************************************************************************/
#ifdef __cplusplus
}
#endif /* __cplusplus */
/****************************************************************************/
#endif /* _GETOPT_H */
/*
* $Id: getopt.h,v 1.2 2005-06-26 09:06:12 obarthel Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2005 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.
*/
#ifndef _GETOPT_H
#define _GETOPT_H
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/
#include <unistd.h>
/****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/****************************************************************************/
#define no_argument 0
#define required_argument 1
#define optional_argument 2
struct option
{
const char * name;
int has_arg;
int * flag;
int val;
};
/****************************************************************************/
extern int getopt_long(int argc, const char **argv, const char *optstring,
const struct option *longopts, int *longindex);
/*extern int getopt_long_only(int argc, const char **argv, const char *optstring,
const struct option *longopts, int *longindex);
*/
extern int optreset;
/****************************************************************************/
#ifdef __cplusplus
}
#endif /* __cplusplus */
/****************************************************************************/
#endif /* _GETOPT_H */

View File

@ -1,5 +1,5 @@
/*
* $Id: math.h,v 1.15 2005-05-30 08:47:41 obarthel Exp $
* $Id: math.h,v 1.16 2005-06-26 09:06:12 obarthel Exp $
*
* :ts=4
*
@ -288,6 +288,14 @@ extern int ilogb(double x);
/****************************************************************************/
extern float exp2f(float x);
extern double exp2(double x);
extern double log2(double x);
extern float log2f(float x);
/****************************************************************************/
#define FLT_EVAL_METHOD 0
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: math_exp2.c,v 1.1 2005-05-29 11:19:00 obarthel Exp $
* $Id: math_exp2.c,v 1.2 2005-06-26 09:06:11 obarthel Exp $
*
* :ts=4
*
@ -44,8 +44,7 @@
double
exp2(double x)
{
/* ZZZ unimplemented */
return(0);
return(pow(2.0, x));
}
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: math_exp2f.c,v 1.1 2005-05-29 11:19:00 obarthel Exp $
* $Id: math_exp2f.c,v 1.2 2005-06-26 09:06:11 obarthel Exp $
*
* :ts=4
*
@ -44,8 +44,7 @@
float
exp2f(float x)
{
/* ZZZ unimplemented */
return(0);
return(powf(2.0, x));
}
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: math_log2.c,v 1.1 2005-05-29 11:19:01 obarthel Exp $
* $Id: math_log2.c,v 1.2 2005-06-26 09:06:11 obarthel Exp $
*
* :ts=4
*
@ -44,8 +44,7 @@
double
log2(double x)
{
/* ZZZ unimplemented */
return(0);
return(log(x) / log(2.0));
}
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: math_log2f.c,v 1.1 2005-05-29 11:19:01 obarthel Exp $
* $Id: math_log2f.c,v 1.2 2005-06-26 09:06:11 obarthel Exp $
*
* :ts=4
*
@ -44,8 +44,7 @@
float
log2f(float x)
{
/* ZZZ unimplemented */
return(0);
return(logf(x) / logf(2.0));
}
/****************************************************************************/