diff options
author | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2011-08-30 13:10:38 +0000 |
---|---|---|
committer | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2011-08-30 13:10:38 +0000 |
commit | 57f281ebed3ffdaaccf39f2848e365c2b6f56443 (patch) | |
tree | 9e49c42da4b19619c677490c87ab28cc113b67d9 /src | |
parent | 3e44562a12efc66b51cd5c4c46e88c2cd2574c49 (diff) | |
download | mpc-57f281ebed3ffdaaccf39f2848e365c2b6f56443.tar.gz |
sin_cos.c: split out sin.c and cos.c to follow gnu coding standards:
one external function per file
get.c: renamed to get_x.c
get_x.c, set_x.c, set_x_x.c contain several external functions; changing this
is maybe exaggerated
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1038 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 18 | ||||
-rw-r--r-- | src/cos.c | 27 | ||||
-rw-r--r-- | src/get_x.c (renamed from src/get.c) | 0 | ||||
-rw-r--r-- | src/sin.c | 27 | ||||
-rw-r--r-- | src/sin_cos.c | 16 |
5 files changed, 64 insertions, 24 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 42369f6..1e99ca9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,14 +20,14 @@ lib_LTLIBRARIES = libmpc.la libmpc_la_LDFLAGS = -version-info 2:0:0 libmpc_la_SOURCES = mpc-impl.h abs.c acos.c acosh.c add.c add_fr.c \ - add_si.c add_ui.c arg.c asin.c asinh.c atan.c atanh.c clear.c cmp.c cmp_si_si.c \ - conj.c cosh.c div_2exp.c div.c div_fr.c div_ui.c exp.c fma.c fr_div.c \ - fr_sub.c get.c get_prec2.c get_prec.c get_version.c imag.c \ - init2.c init3.c inp_str.c log.c mem.c mul_2exp.c mul.c mul_fr.c mul_i.c \ - mul_si.c mul_ui.c neg.c norm.c out_str.c pow.c pow_fr.c pow_ld.c pow_d.c \ - pow_si.c pow_ui.c pow_z.c proj.c real.c urandom.c set.c set_prec.c \ - set_str.c set_x.c set_x_x.c sin_cos.c sinh.c sqr.c sqrt.c strtoc.c \ - sub.c sub_fr.c sub_ui.c swap.c tan.c tanh.c uceil_log2.c ui_div.c \ - ui_ui_sub.c + add_si.c add_ui.c arg.c asin.c asinh.c atan.c atanh.c clear.c cmp.c \ + cmp_si_si.c conj.c cos.c cosh.c div_2exp.c div.c div_fr.c div_ui.c exp.c \ + fma.c fr_div.c fr_sub.c get_prec2.c get_prec.c get_version.c get_x.c \ + imag.c init2.c init3.c inp_str.c log.c mem.c mul_2exp.c mul.c \ + mul_fr.c mul_i.c mul_si.c mul_ui.c neg.c norm.c out_str.c pow.c pow_fr.c \ + pow_ld.c pow_d.c pow_si.c pow_ui.c pow_z.c proj.c real.c urandom.c set.c \ + set_prec.c set_str.c set_x.c set_x_x.c sin.c sin_cos.c sinh.c sqr.c \ + sqrt.c strtoc.c sub.c sub_fr.c sub_ui.c swap.c tan.c tanh.c uceil_log2.c \ + ui_div.c ui_ui_sub.c libmpc_la_LIBADD = @LTLIBOBJS@ diff --git a/src/cos.c b/src/cos.c new file mode 100644 index 0000000..3810f3e --- /dev/null +++ b/src/cos.c @@ -0,0 +1,27 @@ +/* mpc_cos -- cosine of a complex number. + +Copyright (C) 2010, 2011 INRIA + +This file is part of GNU MPC. + +GNU MPC is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +GNU MPC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for +more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program. If not, see http://www.gnu.org/licenses/ . +*/ + +#include "mpc-impl.h" + +int +mpc_cos (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) +{ + return MPC_INEX2 (mpc_sin_cos (NULL, rop, op, 0, rnd)); +} diff --git a/src/sin.c b/src/sin.c new file mode 100644 index 0000000..27df761 --- /dev/null +++ b/src/sin.c @@ -0,0 +1,27 @@ +/* mpc_sin -- sine of a complex number. + +Copyright (C) 2010, 2011 INRIA + +This file is part of GNU MPC. + +GNU MPC is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +GNU MPC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for +more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program. If not, see http://www.gnu.org/licenses/ . +*/ + +#include "mpc-impl.h" + +int +mpc_sin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) +{ + return MPC_INEX1 (mpc_sin_cos (rop, NULL, op, rnd, 0)); +} diff --git a/src/sin_cos.c b/src/sin_cos.c index 4525996..99a0772 100644 --- a/src/sin_cos.c +++ b/src/sin_cos.c @@ -1,4 +1,4 @@ -/* mpc_sin_cos, mpc_sin, mpc_cos -- sine and cosine of a complex number. +/* mpc_sin_cos -- combined sine and cosine of a complex number. Copyright (C) 2010, 2011 INRIA @@ -400,17 +400,3 @@ mpc_sin_cos (mpc_ptr rop_sin, mpc_ptr rop_cos, mpc_srcptr op, return (MPC_INEX12 (inex_sin, inex_cos)); } } - - -int -mpc_sin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) -{ - return MPC_INEX1 (mpc_sin_cos (rop, NULL, op, rnd, 0)); -} - - -int -mpc_cos (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) -{ - return MPC_INEX2 (mpc_sin_cos (NULL, rop, op, 0, rnd)); -} |