Skip to main content
2 of 4
added 357 characters in body; added 6 characters in body; deleted 1 characters in body; added 2 characters in body
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

If I understand you correctly, simply test if the maximum value in the list is Positive:

Positive @ Max @ a

Speed comparison with another method that was posted:

timeAvg = 
  Function[func,
    Do[If[# > 0.3, Return[#/5^i]] & @@ Timing@Do[func, {5^i}], {i, 0, 15}],
    HoldFirst];

a = RandomInteger[{-1*^7, 2}, 1*^7];

Total@UnitStep[-a] =!= Length@a // timeAvg

Positive@Max@a // timeAvg

0.0624

0.01148

Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k