--- a/src/int/fixed.cc
+++ b/src/int/fixed.cc
@@ -1178,7 +1178,7 @@
   */
 
   fp_uint i = num >> x.decsize;
-  fp_uint d = (num & ((x.filter >> x.intsize+1) & x.filter));
+  fp_uint d = (num & ((x.filter >> (x.intsize+1)) & x.filter));
 
   /*
     Print sign.