Monday, December 11, 2017

NaN = "Not a Number" - this is something that I have to deal with 'frequently'.  - There is some documentation on Wikipedia:  https://en.wikipedia.org/wiki/NaN

However, there is - in the increasingly 'sensor driven world' (houses, refrigerators, cars, - even my little 'gadget' called the 'OmniTemp') - there is a 'situation' that arises where a sensor (temperature, pressure, light, liquid-level, etc.) yields something that is NaN. - so - my Question to my Readers is: - how to handle-this - ?
report it to the 'user'?      (How to report to the user?)
wait til you get a 'valid' number?     (wait how long?)
punt?    (punt to where for how long - what is considered a 'success' for 'punting'?)

- but what if the 'system' receives' a 'bunch' of NaNs - what to do - especially if the software needs to use what would NORMALLY be a "REAL" number in a calculation ? - how does the software react? - Harumph!