Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between tertiary and ternary?

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?

like image 792
Dhanapal Avatar asked Aug 10 '10 13:08

Dhanapal


People also ask

What comes after ternary?

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.

Why is it called ternary?

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 .

What is tertiary in C?

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.

What is ternary language?

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.


2 Answers

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".

like image 200
chryss Avatar answered Nov 18 '22 01:11

chryss


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.

like image 39
Jay Avatar answered Nov 18 '22 01:11

Jay