Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory sc8-pr-cvs16:/tmp/cvs-serv19797/algebra

Modified Files:
        algebra.c 
Log Message:
-- fixed bug in atom comparison (discovered by C. Gruen).
   (As the result type of the comparison function is integer 
    ``return 1.9 - 1.1'' resulted in 0 instead of a number unequal
    to zero.)


Index: algebra.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/algebra.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- algebra.c   9 Jan 2007 16:00:53 -0000       1.49
+++ algebra.c   11 Apr 2007 07:15:31 -0000      1.50
@@ -622,8 +622,10 @@
         case aat_int:   return a.val.int_ - b.val.int_;
         case aat_uA:
         case aat_str:   return strcmp (a.val.str, b.val.str);
-        case aat_dec:   return a.val.dec_ - b.val.dec_;
-        case aat_dbl:   return a.val.dbl - b.val.dbl;
+        case aat_dec:   return (a.val.dec_ == b.val.dec_ ? 0
+                                : (a.val.dec_ < b.val.dec_ ? -1 : 1));
+        case aat_dbl:   return (a.val.dbl == b.val.dbl ? 0
+                                : (a.val.dbl < b.val.nat_ ? -1 : 1));
         case aat_bln:   return a.val.bln - b.val.bln;
         case aat_qname: return PFqname_eq (a.val.qname, b.val.qname);
         case aat_node: 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to