I was wondering if it is actually possible to set a special value (like +/-Infinity) to a property on purpose? Because I have this problem:
I created 2 properties that are holding the minimum and the maximum value of a sensor.
When I set up those properties for the very first time I want the MIN property to hold a very big value (so I’m sure when set the minium, the default value isn’t lower than the sensor value). Same thing but opposite for the maximum value.
My question is: there is a constant that return the maximum value for a certain data type (like Double) or I have to set it to a “rule of thumb” value?
I think it’s better to initialize both the minimum and maximum values to the current value of the sensor, since those are, in fact, the minimum and maximum value after your first measurement. Thus, no trickery involved.
If for some reason you don’t know whether the max and min have been initialized, you could include an additional boolean property that you set to true once the initialization has been done.