# Numeric values for MinkowskiQuestionMark

Why NumericQ[MinkowskiQuestionMark[Pi]] returns False? Is it defined only for algebraics? Numerical evaluation gives some number, but a bit surprising: N[MinkowskiQuestionMark[Pi],64] (* 3.015624761581420898437500000000000000000000000000000000000000000 *). Is it correct?

The answer can be found in the documentation of NumericQ:

An expression is considered a numeric quantity if it is either an explicit number or a mathematical constant such as Pi, or is a function that has attribute NumericFunction and all of whose arguments are numeric quantities.

Attributes[MinkowskiQuestionMark]
(* {Listable, Protected, ReadProtected} *)

As for the correctness, you can quickly check yourself. The sum that gives the Minkowski question mark function can be found in the Details section. Using this and the coefficients for the continued fraction, you can do:

a = ContinuedFraction[Pi, 100];
ar = Rest[a];
mqm = a[[1]] +
2 Sum[(-1)^(n + 1)/2^Total[Take[ar, n]], {n, 1, Length[ar]}]

N[mqm, 30]
(* 3.01562476158142089843750000000 *)
• Thank you, I missed it. But why MinkowskiQuestionMark has no NumericFunction attribute? Same for CantorStaircase. Feb 16, 2018 at 19:30
• @AndrzejOdrzywolek The usage statement for NumericFunction is NumericFunction is an attribute that can be assigned to a symbol f to indicate that f[arg_1, arg_2, ...] should be considered a numeric quantity whenever all the arg_i are numeric quantities. Since MinkowskiQuestionMark is only defined over the real line, entering a numeric quantity, i.e. a complex one, won't always yield a numeric result. Feb 16, 2018 at 19:33
• @Chip Interesting point. So basically NumericFunction is function defined on complex plane? Except some singularities, cuts, etc. Feb 16, 2018 at 19:49
• @AndrzejOdrzywolek Yes, it seems that way. I just scraped the documentation for Symbols containing the phrase "Mathematical function, suitable for both symbolic and numerical manipulation." that do not have the NumericFunction attribute. They are {BellB, BellY, BernoulliB, BernsteinBasis, CantorStaircase, DirichletL, EulerE, Fibonorial, MinkowskiQuestionMark, NorlundB, ProductLog, StieltjesGamma, WeierstrassHalfPeriods, WeierstrassInvariants, ZernikeR}. All make sense to me, i.e. have at least one argument that can't be complex, except for ZernikeR it seems. Feb 16, 2018 at 20:16
• @Chip Exceptions are new functions: RealAbs, RealSign. How exactly have you produced above list of functions? Feb 16, 2018 at 20:34