The very rare times I want to use if-and-only-if in a computer program comment, I use the 3-character sequence <=> (or if that jumps out as an operator, <==>). It's a real logic symbol, which officially means the same thing as IFF (Wikipedia logical equivalence), but it more obviously indicates "I'm using a logic symbol". Briefly, if-and-only-if means a=>b and b=>a which is shortened to a<=>b and they both mean "both true or both false".
But I mean "very rare". Possibly very, very rare. For one thing, consider OP's "returns true if foo greater than bar". We wouldn't want to use iff or <=>, even if everyone knew it, since it's implied. If there were other ways to return true, we would have listed them. Saying things that are implied is confusing. Put another way, this is like adding "otherwise returns false".
For another, we rarely want to know IF vs. IFF. Say we're about to write a comment "restarts if idle for more than 20 seconds", but realize if-and-only-if is more accurate and write that. We've now told readers that there's currently no other way of restarting. We've let someone working on restart() know they can safely assume 20 seconds of inactivity. I don't think that's useful.
The few times I actually use <=> is explaining my logic. As a fake example "NOTE: amazingly, edges*2>=vertexes <=> maze can be solved!". I'm telling myself two things: checking for enough edges is a quick way to know the maze is usable; and checking for not enough edges is a quick way to know the maze isn't.
foo
is larger thanbar
.".