0
$\begingroup$

I have two sets:

$A=\{x| |x|<2\}, B=\{1,2,3\}$

and I know

A=Interval[{-2,2}]
B={1,2,3}

but

A \[Intersection] B

can not execute.

$\endgroup$
  • 3
    $\begingroup$ Select[B, IntervalMemberQ[A, #] &] $\endgroup$ – corey979 Dec 1 '16 at 2:14
  • 2
    $\begingroup$ Never use upper-case letters for variables, sets, etc., as they may conflict with Mathematica's system names. $\endgroup$ – David G. Stork Dec 1 '16 at 2:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.