     // - isnan() and min() are defined in cupy/complex.cuh
     if (isnan(a)) {return a;}
     else if (isnan(b)) {return b;}
-    else {return min(a, b);}
+    else {return a < b ? a : b;}
+    //complex<float> ans;
+    //if (isnan(a)) {ans = a;}
+    //else if (isnan(b)) {ans = b;}
+    //else {ans = (a < b ? a : b);}
+    //printf("I got %f + I %f\n", ans.real(), ans.imag());
+    //return ans;
 }
 
 // specialization for complex<double> for handling NaNs


template <> struct NumericTraits<complex<float>>  : BaseTraits<FLOATING_POINT, true, false, unsigned int, complex<float>> {};
template <> struct NumericTraits<complex<double>> : BaseTraits<FLOATING_POINT, true, false, unsigned long long, complex<double>> {};
/* ------------------------------------ end of boilerplate ------------------------------------ */
#endif


/* ------------------------------------ "Patches" to CUB ------------------------------------

    // - isnan() and max() are defined in cupy/complex.cuh
    if (isnan(a)) {return a;}
    else if (isnan(b)) {return b;}
    else {return a < b ? b : a;}
}

// specialization for complex<double> for handling NaNs
