Update of /cvsroot/monetdb/MonetDB5/src/modules/kernel
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28245/src/modules/kernel

Modified Files:
        calc.mx mmath.mx 
Log Message:
propagated changes of Monday Dec 03 2007 - Tuesday Dec 18 2007
from the MonetDB_5-2 branch to the development trunk


Index: mmath.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/kernel/mmath.mx,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- mmath.mx    13 Dec 2007 20:22:44 -0000      1.37
+++ mmath.mx    18 Dec 2007 10:48:03 -0000      1.38
@@ -85,6 +85,12 @@
 comment "The tan(x) function returns the tangent of x,
         where x is given in radians";
 
+command cot(x:flt)       :flt 
+address MATHunary_COTflt;
+command cot(x:dbl)       :dbl 
+address MATHunary_COTdbl
+comment "The cot(x) function returns the Cotangent of x,
+        where x is given in radians";
 
 command cosh(x:flt)     :flt 
 address MATHunary_COSHflt;
@@ -357,6 +363,7 @@
 @:unop(_COS,cos)@
 @:unop(_SIN,sin)@
 @:unop(_TAN,tan)@
+@:unop(_COT,cot)@
 
 @:unop(_COSH,cosh)@
 @:unop(_SINH,sinh)@
@@ -559,6 +566,7 @@
 @:unopM5(_COS,cos)@
 @:unopM5(_SIN,sin)@
 @:unopM5(_TAN,tan)@
+@:unopM5(_COT,cot)@
 
 @:unopM5(_COSH,cosh)@
 @:unopM5(_SINH,sinh)@

Index: calc.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/kernel/calc.mx,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- calc.mx     27 Nov 2007 09:12:16 -0000      1.64
+++ calc.mx     18 Dec 2007 10:48:02 -0000      1.65
@@ -313,16 +313,21 @@
                comment "negative value";
                command length(x:@1):int
                address [EMAIL PROTECTED];
[EMAIL PROTECTED]
+               command sign(x:@1) :@1 
+               address [EMAIL PROTECTED] 
+               comment "Returns +1, 0, -1 based on the sign of the given 
expression";
[EMAIL PROTECTED] unary_ops
+       @:@1_unary_ops(chr)@
+       @:@1_unary_ops(bte)@
+       @:@1_unary_ops(sht)@
+       @:@1_unary_ops(int)@
+       @:@1_unary_ops(wrd)@
+       @:@1_unary_ops(flt)@
+       @:@1_unary_ops(lng)@
+       @:@1_unary_ops(dbl)@
 @mal
-       @:mal_unary_ops(chr)@
-       @:mal_unary_ops(bte)@
-       @:mal_unary_ops(sht)@
-       @:mal_unary_ops(int)@
-       @:mal_unary_ops(wrd)@
-       @:mal_unary_ops(lng)@
-       @:mal_unary_ops(flt)@
-       @:mal_unary_ops(dbl)@
+@:unary_ops(mal)@
+
        command length(x:str):int
        address CALClengthstr;
 @-
@@ -564,35 +569,10 @@
 /* the normal implementation of an operator is to just stick the
    operator between the operands */
 #define calc_abs(s) ((s)>0)?(s):-(s)
-@:calc_unop(ABS,calc_abs,chr)@
-@:calc_unop(ABS,calc_abs,bte)@
-@:calc_unop(ABS,calc_abs,sht)@
-@:calc_unop(ABS,calc_abs,int)@
-@:calc_unop(ABS,calc_abs,wrd)@
-@:calc_unop(ABS,calc_abs,flt)@
-@:calc_unop(ABS,calc_abs,dbl)@
-@:calc_unop(ABS,calc_abs,lng)@
-
 #define calc_inv(s) (1/(s))
-@:check_unop(INV,calc_inv,chr)@
-@:check_unop(INV,calc_inv,bte)@
-@:check_unop(INV,calc_inv,sht)@
-@:check_unop(INV,calc_inv,int)@
-@:check_unop(INV,calc_inv,wrd)@
-@:check_unop(INV,calc_inv,flt)@
-@:check_unop(INV,calc_inv,dbl)@
-@:check_unop(INV,calc_inv,lng)@
-
 #define calc_neg(s) (-(s))
-@:calc_unop(NEG,calc_neg,chr)@
-@:calc_unop(NEG,calc_neg,bte)@
-@:calc_unop(NEG,calc_neg,sht)@
-@:calc_unop(NEG,calc_neg,int)@
-@:calc_unop(NEG,calc_neg,wrd)@
-@:calc_unop(NEG,calc_neg,flt)@
-@:calc_unop(NEG,calc_neg,dbl)@
-@:calc_unop(NEG,calc_neg,lng)@
[EMAIL PROTECTED]
+#define calc_sign(s) ((s)<0)?-1:((s)==0)?0:1
+
 @= calc_length
 calc_export str [EMAIL PROTECTED](int *res , @1 *a );
 str [EMAIL PROTECTED](int *res , @1 *a ) {
@@ -601,14 +581,14 @@
 }
 @c
 
-@:calc_length(chr)@
-@:calc_length(bte)@
-@:calc_length(sht)@
-@:calc_length(int)@
-@:calc_length(wrd)@
-@:calc_length(flt)@
-@:calc_length(dbl)@
-@:calc_length(lng)@
[EMAIL PROTECTED] c_unary_ops
+@:calc_unop(ABS,calc_abs,@1)@
+@:check_unop(INV,calc_inv,@1)@
+@:calc_unop(NEG,calc_neg,@1)@
+@:calc_unop(SIGN,calc_sign,@1)@
+@:calc_length(@1)@
[EMAIL PROTECTED]
+@:unary_ops(c)@
 
 calc_export str CALClengthstr(int *res , str *a );
 str CALClengthstr(int *res , str *a ) {


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to