We have a function and a piece of code that validates that one of specific parameters is present. Besides arguing whether we should state nullity or presence (e.g. Only one is not null vs Only one is present), we have a confusion about which word is more appropriate when it is used to state that there's only one conforms to a condition.

In other words, should we say Only one not null or Exactly one not null meaning that one parameter is present, but all others are absent?

Or maybe "Either is present" would be a perfect match? What do you think?


"Exactly one" clearly says that there must be one and not zero or two or any other number.

"Only one" is a little less explicit; it could mean that zero is also an acceptable value. Like if you said, "You can enter the contest only one time per day", I don't think most people would understand that to mean that you MUST enter every day. One is the upper limit.

  • Good example showing how only one/once can often mean at most one/once (i.e. - zero or never could be included) - which potential ambiguity disappears once you bring in exactly. Jun 6 '17 at 15:58

In math context, "exactly one" is a better, more precise quantifier. It is common in math to see that "there is exactly one" or "there is precisely one" means "there is one and only one", which means "there is at most and at least one".

In everyday English, things may not be that strict. However, consider this example: "Terry is the only one who can solve this problem". If we meet this sentence in a casual setting, we probably take it as "Terry can solve this problem and no others can". However, strictly speaking, what the sentence means is "if someone can solve this problem, then this someone is Terry", which does not assert that Terry can solve the problem.

  • Just for interest's sake, I compared equation has exactly/only one solution in Google NGrams (I think we can safely say virtually all hits would be in a "maths" context). I agree exactly focuses the reader's attention more, but it's not (yet?) become the preferred version. Jun 6 '17 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.