Fixes 3 Dialyzer warnings about impossible comparisons when checking for NaN and infinity values in sensor validation. Problem: Dialyzer correctly identified that comparing a float with atoms (:nan, :infinity, :neg_infinity) using == can never evaluate to true. The previous code attempted to validate sensor values by comparing with these atoms, which is incorrect in Erlang/Elixir. Solution: Use proper float comparison techniques: - NaN detection: value != value (NaN is the only value that doesn't equal itself) - Infinity detection: value > 1.0e308 or value < -1.0e308 (beyond max float range) This approach correctly identifies special float values without impossible comparisons that Dialyzer flags. Dialyzer results: - Before: Total errors: 509, Skipped: 506 - After: Total errors: 506, Skipped: 506 - Status: done (passed successfully), EXIT CODE: 0 All 3434 tests passing. Validation logic now correctly identifies NaN and infinity values while satisfying Dialyzer type analysis. |
||
|---|---|---|
| .. | ||
| mix/tasks | ||
| snmpkit | ||
| towerops | ||
| towerops_web | ||
| snmp_lib.ex | ||
| snmp_mgr.ex | ||
| snmpkit.ex | ||
| towerops.ex | ||
| towerops_native.ex | ||
| towerops_web.ex | ||