79544717

Date: 2025-03-30 14:24:05
Score: 1
Natty:
Report link

I've been trying to write this as a comment, but the system tells me that I'm not allowed to do so, so I write it as an answer.

In case 'a' is not just a number but an expression or something much longer than just a character, rather than writing a == a it may be much more convenient to write a*0 == 0 which is equally applicable to an if statement. In this particular case, if you want to do something whenever a is not a nan,

if (a*0==0) {do whatever}

Or, conversely, if you want to do something only when a=nan,

(a*0!=0) {do whatever}

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: user24353751