diff -r 5a4090aee968 libinterp/octave-value/ov-base-diag.cc
--- a/libinterp/octave-value/ov-base-diag.cc	Mon Jun 27 22:02:24 2016 -0700
+++ b/libinterp/octave-value/ov-base-diag.cc	Wed Jun 29 08:43:50 2016 -0700
@@ -281,12 +281,12 @@ octave_base_diag<DMT, MT>::is_true (void
   if (dims ().numel () > 1)
     {
       warn_array_as_logical (dims ());
-                                     // Throw error if any NaN or NA.
+      // Throw error if any NaN or NA by calling is_true().
       octave_value (matrix.extract_diag ()).is_true ();
-      return false;                  // > 1x1 diagonal always has zeros
+      return false;                 // > 1x1 diagonal always has zeros
     }
   else
-    return to_dense ().is_true ();   // 0x0 or 1x1, handle NaN etc.
+    return to_dense ().is_true ();  // 0x0 or 1x1, handle NaN etc.
 }
 
 // FIXME: This should be achieveable using ::real
diff -r 5a4090aee968 libinterp/octave-value/ov-perm.cc
--- a/libinterp/octave-value/ov-perm.cc	Mon Jun 27 22:02:24 2016 -0700
+++ b/libinterp/octave-value/ov-perm.cc	Wed Jun 29 08:43:50 2016 -0700
@@ -131,15 +131,15 @@ octave_perm_matrix::do_index_op (const o
   return retval;
 }
 
-// Return true if this matrix has all true elements (non-zero, not NA/NaN).
-// A permutation cannot have NA / NaN.
+// Return true if this matrix has all true elements (non-zero, not NaN/NA).
+// A permutation cannot have NaN/NA.
 bool
 octave_perm_matrix::is_true (void) const
 {
   if (dims ().numel () > 1)
     {
       warn_array_as_logical (dims ());
-      return 0;       // > 1x1 permutation always has zeros, and no NaN.
+      return false;    // > 1x1 permutation always has zeros, and no NaN.
     }
   else
     return dims ().numel ();    // 1x1 is [1] == true, 0x0 == false.
diff -r 5a4090aee968 libinterp/octave-value/ov-range.cc
--- a/libinterp/octave-value/ov-range.cc	Mon Jun 27 22:02:24 2016 -0700
+++ b/libinterp/octave-value/ov-range.cc	Wed Jun 29 08:43:50 2016 -0700
@@ -264,8 +264,8 @@ octave_range::diag (octave_idx_type m, o
   return mat.diag (m, n);
 }
 
-// Return true if this range has all true elements (non-zero, not NA/NaN).
-// A range cannot have NA / NaN.
+// Return true if this range has all true elements (non-zero, not NaN/NA).
+// A range cannot have NaN/NA.
 bool
 octave_range::is_true (void) const
 {
@@ -286,8 +286,7 @@ octave_range::is_true (void) const
       else
         {
           /*
-          // This tells us whether one element is 0
-          // *if* arithmetic is exact.
+          // This tells us whether one element is 0, if arithmetic is exact.
           double steps_to_zero = base / r.inc ();
 
           retval = (steps_to_zero != floor (steps_to_zero));
@@ -296,7 +295,7 @@ octave_range::is_true (void) const
           // FIXME: this is a waste of memory.
           Matrix m ((range.matrix_value ().all ()).all ());
 
-          retval = (m.rows () == 1 && m.columns () == 1 && m (0, 0) != 0.0);
+          retval = ! m.is_empty () && m(0, 0) != 0.0;
         }
     }
 
diff -r 5a4090aee968 libinterp/octave-value/ov.cc
--- a/libinterp/octave-value/ov.cc	Mon Jun 27 22:02:24 2016 -0700
+++ b/libinterp/octave-value/ov.cc	Wed Jun 29 08:43:50 2016 -0700
@@ -1410,13 +1410,14 @@ octave_value::is_equal (const octave_val
       octave_value tmp = do_binary_op (octave_value::op_eq, *this, test);
 
       // Empty array also means a match.
-      // (Call all() explicitly, to avoid Octave:array-as-logical warning.)
       if (tmp.is_defined ())
         {
           if (tmp.is_empty ())
             retval = true;
           else
             {
+              // Reshape into a vector and call all() explicitly,
+              // to avoid Octave:array-as-logical warning.
               tmp = tmp.reshape (dim_vector (tmp.numel (), 1));
               retval = tmp.all ().is_true ();
             }
diff -r 5a4090aee968 liboctave/array/Sparse.cc
--- a/liboctave/array/Sparse.cc	Mon Jun 27 22:02:24 2016 -0700
+++ b/liboctave/array/Sparse.cc	Wed Jun 29 08:43:50 2016 -0700
@@ -199,7 +199,7 @@ Sparse<T>::SparseRep::any_element_is_nan
   octave_idx_type nz = nnz ();
 
   for (octave_idx_type i = 0; i < nz; i++)
-    if (octave::math::isnan(d[i]))
+    if (octave::math::isnan (d[i]))
       return true;
 
   return false;
