Std::isnan should be used

We just discovered some usages of value == NAN in our codebase which is by definition wrong and std::isnan should have been used instead.

It seems there is no sonar rule to check for this. I see that this check exists for other languages like TypeScript and JavaScript so I wonder if there is a specific reason why this is not there for C++ or if this is just something that wasn’t added yet.

Hi @mheinem,

We already have a ticket about this: Jira

It has not been planned for now, but I will add to it that you are interested in it.

1 Like