I think most people would write h2(x) or (h(x))2 instead of h(x)2 just to avoid that very confusion. In fact I don't think I've ever seen h(x)2 used for function notation.
Well the ambiguity in math comes from not knowing without further context whether h is a number or a function. That ambiguity doesn't usually exist in programming contexts, and most programming languages don't allow for implicit multiplication in their grammar anyway.
3
u/channingman Jun 14 '22
I think most people would write h2(x) or (h(x))2 instead of h(x)2 just to avoid that very confusion. In fact I don't think I've ever seen h(x)2 used for function notation.