Quantcast
Channel: Active questions tagged string-manipulation - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 186

Multiple calculations in a condition

$
0
0

I want to add and subtract 3 from a list.

pos = {82,84}

If[# > 3,       (# - 3) && (# + 3)] & /@ pos

the output I want:

{79,85,81,87}

the output I get:

{79 && 85, 81 && 87}

Viewing all articles
Browse latest Browse all 186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>