It is my understanding that, the conditional operator ( condition ? consequence : alternative ) is often referred to as both the “tertiary operator” and the “ternary operator”.
What is the difference between these terms?
Ternary is the integer base with the lowest radix economy, followed closely by binary and quaternary. This is due to its proximity to the mathematical constant e.
The name ternary refers to the fact that the operator takes three operands. The condition is a boolean expression that evaluates to either true or false .
The programmers utilize the ternary operator in case of decision making when longer conditional statements like if and else exist. In simpler words, when we use an operator on three variables or operands, it is known as a Ternary Operator.
Ternary is an esoteric programming language created by zerosum0x0 in 2015. It consists only of the ASCII characters 0, 1, and 2. It is a member of the TrivialBrainfuckSubstitution family of programming languages.
The Tertiary is a geological period, 65 million to 1.8 million years ago.
Seriously, though, "tertiary" means "third in rank" -- not necessarily in value, but maybe sequentially, as in primary, secondary and tertiary education. You want a term that relates to involving three arguments, and that's "ternary", and goes with "binary" and "unary".
If it is called tertiary, it is erroneously so.
Tertiary means "third [level]" whereas ternary means "having three parts." These are not programming definitions -- just what the words mean.
Clearly, the operator is ternary (1 ? 2 : 3;
), but tertiary makes no sense in this case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With