Skip to main content

function construction - Testing for a vector of reals




Suppose I define:


RealVector[expr_]:=VectorQ[expr,NumberQ[#]&&Head[#]===Real)];

Then:


RealVector[{1,2,3}];  RealVector[{1.,2.,3.}];

should evaluate to False and True, resp. But I get False and False. Why?




Comments