Changeset: 43d19a43a1d6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=43d19a43a1d6
Modified Files:
        monetdb5/modules/kernel/batmmath.c
        monetdb5/modules/kernel/mmath.c
Branch: default
Log Message:

add batmmath version of 'cot'


diffs (84 lines):

diff --git a/monetdb5/modules/kernel/batmmath.c 
b/monetdb5/modules/kernel/batmmath.c
--- a/monetdb5/modules/kernel/batmmath.c
+++ b/monetdb5/modules/kernel/batmmath.c
@@ -379,6 +379,18 @@ CMDscience_bat_##FUNC(Client cntxt, MalB
 }
 
 static double
+cot(double x)
+{
+       return (1/tan(x));
+}
+
+static float
+cotf(float x)
+{
+       return (1/tan(x));
+}
+
+static double
 radians(double x)
 {
        return x * (M_PI / 180.0);
@@ -402,12 +414,13 @@ degreesf(float x)
        return (float) (x * (180.0 / M_PI));
 }
 
+scienceImpl(acos)
 scienceImpl(asin)
-scienceImpl(acos)
 scienceImpl(atan)
 scienceImpl(cos)
 scienceImpl(sin)
 scienceImpl(tan)
+scienceImpl(cot)
 scienceImpl(cosh)
 scienceImpl(sinh)
 scienceImpl(tanh)
@@ -457,6 +470,10 @@ mel_func batmmath_init_funcs[] = {
  pattern("batmmath", "tan", CMDscience_bat_tan, false, "", args(1,3, 
batarg("",dbl),batarg("x",dbl),batarg("s",oid))),
  pattern("batmmath", "tan", CMDscience_bat_tan, false, "", args(1,2, 
batarg("",flt),batarg("x",flt))),
  pattern("batmmath", "tan", CMDscience_bat_tan, false, "", args(1,3, 
batarg("",flt),batarg("x",flt),batarg("s",oid))),
+ pattern("batmmath", "cot", CMDscience_bat_cot, false, "", args(1,2, 
batarg("",dbl),batarg("x",dbl))),
+ pattern("batmmath", "cot", CMDscience_bat_cot, false, "", args(1,3, 
batarg("",dbl),batarg("x",dbl),batarg("s",oid))),
+ pattern("batmmath", "cot", CMDscience_bat_cot, false, "", args(1,2, 
batarg("",flt),batarg("x",flt))),
+ pattern("batmmath", "cot", CMDscience_bat_cot, false, "", args(1,3, 
batarg("",flt),batarg("x",flt),batarg("s",oid))),
  pattern("batmmath", "cosh", CMDscience_bat_cosh, false, "", args(1,2, 
batarg("",dbl),batarg("x",dbl))),
  pattern("batmmath", "cosh", CMDscience_bat_cosh, false, "", args(1,3, 
batarg("",dbl),batarg("x",dbl),batarg("s",oid))),
  pattern("batmmath", "cosh", CMDscience_bat_cosh, false, "", args(1,2, 
batarg("",flt),batarg("x",flt))),
diff --git a/monetdb5/modules/kernel/mmath.c b/monetdb5/modules/kernel/mmath.c
--- a/monetdb5/modules/kernel/mmath.c
+++ b/monetdb5/modules/kernel/mmath.c
@@ -154,7 +154,6 @@ MATHbinary_ROUND##TYPE(TYPE *res, const 
 unopM5(_ACOS,acos)
 unopM5(_ASIN,asin)
 unopM5(_ATAN,atan)
-binopM5(_ATAN2,atan2)
 unopM5(_COS,cos)
 unopM5(_SIN,sin)
 unopM5(_TAN,tan)
@@ -170,11 +169,9 @@ unopM5(_EXP,exp)
 unopM5(_LOG,log)
 unopM5(_LOG10,log10)
 unopM5(_LOG2,log2)
-
-binopM5(_LOG,logbs)
+unopM5(_SQRT,sqrt)
 
-binopM5(_POW,pow)
-unopM5(_SQRT,sqrt)
+
 #ifdef HAVE_CBRT
 unopM5(_CBRT,cbrt)
 #else
@@ -184,6 +181,10 @@ unopM5NOT(_CBRT,cbrt)
 unopM5(_CEIL,ceil)
 unopM5(_FLOOR,floor)
 
+binopM5(_ATAN2,atan2)
+binopM5(_POW,pow)
+binopM5(_LOG,logbs)
+
 static str
 MATHunary_FABSdbl(dbl *res , const dbl *a)
 {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to