"If there are 0 or 1 messages" or "If there is 0 or 1 message"?

I'm trying to say "Do something if there are 0 or 1 messages" but am not sure exactly how to phrase that.

Do I use the singular, plural, or none of the above?

• I recommend: "If there are fewer than 2 messages..."
– user39720
Commented Apr 24, 2014 at 23:25
• This is very reminiscent of the old chestnut 'Is it "One or more is" or "One or more are"?' I'd say some people will argue one way or the other here, and some will say 'either' – possibly followed by 'but "Do something if there are 0 or 1 messages" sounds better'. It's an interesting problem, but easily avoided by dingo's work-around. Commented Apr 24, 2014 at 23:34
• What can you do if there are 0 messages that relates to messages? Commented Apr 24, 2014 at 23:34
• @Oldcat It's a source code comment. Commented Jan 9, 2015 at 0:30

A correspondence I've seen mathematicians use goes something like

x < 2, fewer than two

x ≤ 2, at most (or no more than) two

x = 2, exactly two

x ≥ 2, at least two

x > 2, more than two

where x could be the number of messages.

So in this case I recommend: "If there are fewer than 2 messages..."

One way to phrase it is:

if the number of messages is equal to 1 or 0, then do something