Why does the warning still print even though i checked if its not

local waitValue = gloveStatsConfig.Speed.Value
local isSafe = not (waitValue ~= waitValue or waitValue == math.huge)
task.wait(isSafe and waitValue or 0)

I keep getting the error that the wait value for task.wait is nan or infinite, even though I check before hand if it is nan or infinite. Is there something wrong?

As far as the linter is concerned task.wait is called with either 0 or waitValue. It is apparently not smart enough to rule out NaN or huge based on the conditions under which the ternary is false. If you want this level of precise reasoning you need a bounded model checker.

I know what nan is, but not how it’s really calculated so I searched ‘what is nan’ and found this explanation of why checking if nan == nan returns false.

how do i get a “bounded model checker”?