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.

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_precedenceform, organization={Wolfram Research}, title={PrecedenceForm}, year={1988}, url={https://reference.wolfram.com/language/ref/PrecedenceForm.html}, note=[Accessed: 18-November-2024 ]}