PrecedenceForm

PrecedenceForm[expr,prec]

prints with expr parenthesized as it would be if it contained an operator with precedence prec.

Details

  • prec must be an integer. See notes for Infix.

Examples

open allclose all

Basic Examples  (1)

Force parenthesization by lowering the effective precedence of multiplication:

Scope  (1)

Define an operator |> using Infix:

Give the operator precedence higher than Plus but lower than Times:

Give the operator precedence higher than both Plus and Times:

Give the operator lowest precedence:

Wolfram Research (1988), PrecedenceForm, Wolfram Language function, https://reference.wolfram.com/language/ref/PrecedenceForm.html.

Text

Wolfram Research (1988), PrecedenceForm, Wolfram Language function, https://reference.wolfram.com/language/ref/PrecedenceForm.html.

BibTeX

@misc{reference.wolfram_2020_precedenceform, author="Wolfram Research", title="{PrecedenceForm}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/PrecedenceForm.html}", note=[Accessed: 02-March-2021 ]}

BibLaTeX

@online{reference.wolfram_2020_precedenceform, organization={Wolfram Research}, title={PrecedenceForm}, year={1988}, url={https://reference.wolfram.com/language/ref/PrecedenceForm.html}, note=[Accessed: 02-March-2021 ]}

CMS

Wolfram Language. 1988. "PrecedenceForm." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PrecedenceForm.html.

APA

Wolfram Language. (1988). PrecedenceForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PrecedenceForm.html