Changeset: 46c2247aee4d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=46c2247aee4d
Modified Files:
        MonetDB5/src/modules/kernel/batmmath.mx
Branch: default
Log Message:

Fix changeset e6e8de5cb0ca.
- Add parentheses around right-hand-side of #define so that it can be
  used as a function (cast binds closer than multiplication, so cast
  didn't have desired effect).
- Actually *use* third argument of Mx macro and remove cast as
  intended by the changeset (it added the arg to the wrong macro).
- Also add a third argument to the other Mx macro to complete the
  change.
- Added radiansf and degreesf macros.


diffs (47 lines):

diff -r f34bcb57040a -r 46c2247aee4d MonetDB5/src/modules/kernel/batmmath.mx
--- a/MonetDB5/src/modules/kernel/batmmath.mx   Wed Dec 08 11:47:16 2010 +0100
+++ b/MonetDB5/src/modules/kernel/batmmath.mx   Wed Dec 08 13:30:04 2010 +0100
@@ -95,8 +95,10 @@
 #define batmmath_export extern
 #endif
 
-#define radians(x)       x * 3.14159265358979323846 /180.0
-#define degrees(x)       x * 180.0/3.14159265358979323846
+#define radians(x)       ((x) * 3.14159265358979323846 / 180.0)
+#define degrees(x)       ((x) * 180.0 / 3.14159265358979323846)
+#define radiansf(x)      ((flt) radians(x))
+#define degreesf(x)      ((flt) degrees(x))
 @-
 @= scienceFcnImpl
 batmmath_export str cmdscience_b...@2_@1(int *ret, int *bid);
@@ -115,10 +117,10 @@
        BATaccessBegin(b, USE_TAIL, MMAP_SEQUENTIAL);
        if (b->T->nonil){
                for(;p<q; o++, p++)
-                       *o = (@2) @1(*p);
+                       *o = @1...@3(*p);
        } else
                for(;p<q; o++, p++){
-                       *o = *p == @2_nil? @2_nil: (@2) @1(*p);
+                       *o = *p == @2_nil? @2_nil: @1...@3(*p);
                }
        BATaccessEnd(b, USE_TAIL, MMAP_SEQUENTIAL);
        BATsetcount(bn, BATcount(b));
@@ -203,11 +205,11 @@
        round is not binary...
        @:scienceBinaryImpl(round,int)@
 @c
-@:scienceBinaryImpl(fmod,dbl)@
-@:scienceBinaryImpl(fmod,flt)@
-@:scienceBinaryImpl(atan2,dbl)@
-@:scienceBinaryImpl(atan2,flt)@
-@:scienceBinaryImpl(pow,dbl)@
-@:scienceBinaryImpl(pow,flt)@
+@:scienceBinaryImpl(fmod,dbl,)@
+@:scienceBinaryImpl(fmod,flt,f)@
+@:scienceBinaryImpl(atan2,dbl,)@
+@:scienceBinaryImpl(atan2,flt,f)@
+@:scienceBinaryImpl(pow,dbl,)@
+@:scienceBinaryImpl(pow,flt,f)@
 
 @}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to