Is there an attribute for symbols that makes NumericQ give True? For example Pi and E are symbols that behave this way, but I can't figure out which attribute to give it.

NumericFunction works well provided the symbol takes at least one argument:


(*False   <--- I want this to be true*)


But I need something for just symbols.


1 Answer 1


I'm not sure if this is the official way to do it, but at least in you can simply assign it:

NumericQ[f] = True

For example:

N[twopi, n_] := N[2*Pi, n]
NumericQ[twopi] = True
{twopi, twopi > 1}
==> {twopi, True}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.