Seeed-Studio / Grove_Temperature_And_Humidity_Sensor

Arduino library for the DHT series temperature&humidity sensors
http://www.seeedstudio.com/depot/grove-temperaturehumidity-sensor-pro-p-838.html
MIT License
66 stars 61 forks source link

Why do not define the NAN as sqrt(-1) #6

Closed francescofiorenza closed 5 years ago

francescofiorenza commented 6 years ago

I decided to set #define NAN as sqrt(-1) instead of #define NAN 0 because a read of the temperature equal to zero is indistinguishable from a fail. It is possible to change also the library?

KillingJacky commented 6 years ago

Hi @francescofiorenza Fix. Used the NAN defination in C99 standard, which can be tested with isnan(x) function.