ternary
C2Pronunciation
UK
- /tˈɜːnəri/
US
- /ˈtɜr.nə.ri/not-comparableadjective
- /ˈtɜr.nə.ri/noun
Description
- Three-part
- Consisting of three
- Based on the number three
Think of the "tri-" prefix in "triangle"—ternary means relating to or made of three parts. It is not a word you'll use every day, but it often appears in math, computer science, and music. In coding, a ternary operator is a short way to write an if-else statement, so named because it has three parts. In music, ternary form (ABA) describes a pattern where one section returns after a different middle section. It all comes back to the idea of three.
The word "ternary" comes from the Latin ternarius, meaning "consisting of three." While we often navigate the world through binary choices—yes or no, on or off—ternary systems and structures operate using three components.
Most commonly, you'll encounter "ternary" in technical fields. In mathematics, a ternary number system uses base-three (the digits 0, 1, and 2) instead of our usual base-ten system. In computer science, a ternary operator is a concise way to write conditional expressions—essentially an if-else statement condensed into a single line. It is unique because it is the only operator in most languages that takes three operands, typically written as: `result = (condition) ? value_if_true : value_if_false`.
But ternary isn't limited to numbers and code! In music, "ternary form" (ABA) is a fundamental structure where a main theme is presented, followed by a contrasting section, and finished with a return to the original theme. You can think of it like a classic story arc: introduction, complication, and resolution.
You might also encounter a "ternary plot" in geology or chemistry—a triangular diagram used to represent the proportions of three different components in a mixture. It's a specialized term, but remembering that "ternary" always points back to the number three will help you decipher its meaning whenever it appears.
Examples
- 1
Number systems
The lesson compares binary and ternary number systems.
- 2
Programming
In JavaScript, a ternary operator can shorten a simple `if-else` statement.
Domain
in programming, a ternary operator is a short form like `condition ? result1 : result2`
- 3
Data chart
The report includes a ternary diagram to show how the sample is divided among three materials.
Meaning
ternary diagram
a triangle-shaped chart used for data with three parts
Forms and spellings
1 form open this card.
Main spelling
- ternarynounadjective