Index: include/parallel/partial_sum.h
===================================================================
--- include/parallel/partial_sum.h	(revision 160253)
+++ include/parallel/partial_sum.h	(working copy)
@@ -127,10 +127,12 @@
 	    equally_split(__n, __num_threads + 1, __borders);
 	  else
 	    {
-	      _DifferenceType __chunk_length =
-		((double)__n
-		 / ((double)__num_threads + __s.partial_sum_dilation)),
-		__borderstart = __n - __num_threads * __chunk_length;
+	      _DifferenceType
+		  __first_part_length = std::max<_DifferenceType>(1,
+		    (float)__n /
+		    (1.0 + __s.partial_sum_dilation * (float)__num_threads)),
+		  __chunk_length = (__n - __first_part_length) / __num_threads,
+		  __borderstart = __n - __num_threads * __chunk_length;
 	      __borders[0] = 0;
 	      for (_ThreadIndex __i = 1; __i < (__num_threads + 1); ++__i)
 		{
