WordGarden.io
Back to search

arity

noun

Pronunciation

UK

  • /ˈærɪtɪ/

US

  • /ˈærɪti/

Description

Imagine you're building with LEGO bricks. Some pieces only connect to one other piece—they have an "arity" of one. Others snap together with two, three, or even four. In math and computer science, "arity" describes the number of inputs (arguments/operands) a function or operation needs to work. A plus sign (+) is usually treated as a binary operator: it has an arity of two because it combines two numbers (like 2 + 3). Unary minus (as in -5) has an arity of one because it takes a single input. So, arity is all about how many things something "wants" to operate on.

Examples

  1. 1

    Programming languages

    In this language, every function has an arity, so the compiler can check your calls.

  2. 2

    Operators

    The `+` operator usually has an arity of two, but some languages also allow a one-argument version.

  3. 3

    Function arguments

    Our parser handles both fixed-arity and variable-arity functions.

    • Domain

      in programming, variable-arity functions can take different numbers of arguments

Forms and spellings

1 form open this card.

Main spelling

  • aritynoun