Advertisement
Guest User

Untitled

a guest
Jul 26th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. {3, -5, 2, 7, -6, 3} /. x_ /; x < 0 :> 0
  2. (*{3, 0, 2, 7, 0, 3}*)
  3.  
  4. {3, -5, 2, 7, -6, 3} /. _?Negative :> 0
  5. (*{3, 0, 2, 7, 0, 3}*)
  6.  
  7. {3, -5, 2, 7, -6, 3} /. _?(< 0) :> 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement