Re: [proximity] Meaning of negative values

Cathy

My understanding is that meaningful values are positive in the range of min - max but that a ‘negative infinity’ value is used to represent ‘undefined’.

Value is a double so it can be negative, but only positive values have meaning for this API. The negative infinity value is used as a special case indicator to mean no value has been assigned (e.g. not supported or available).

Thus for min, max and value the negative and positive infinity values are used to indicate ‘no defined value’ - I guess Javascript NaN or ‘undefined’ could be used instead of this convention, but this way it is always a number and just requires a value test. I wonder if there is a documented set of conventions for the HTML5 family of specs that would include this.

The language about returning the ‘value it was initialized to’ is not very clear. What it really means is ‘return the value determined by the device which is either the actual value or the indicator that no value is available’. 

Thus in general no negative values should be found other than negative infinity.

Does this make sense?

regards, frederick


On May 12, 2014, at 1:51 PM, ext Chan Cathy (Nokia-CTO/Boston) <cathy.chan@nokia.com> wrote:

> I'd imagine this would have been discussed, but can anyone remind me what a negative device proximity value mean? An object is detected at the "back" side of the device? 
> 
> [[
> The current device proximity is a value that represents the proximity of the hosting device to a physical object (i.e., some value between the maximum sensing distance and the minimum sensing distance), in centimeters. 
> The minimum sensing distance at which the sensor can detect a physical object, in centimeters. 
> The maximum sensing distance at which the sensor can detect a physical object, in centimeters. 
> ]]
> 
> [[
> The min attribute of the DeviceProximityEvent interface MUST return the value it was initialized to. When the object is created, this attribute MUST be initialized to negative Infinity. It represents the minimum sensing distance.
> ]]
> 
> Thanks.
> 
> - Cathy.
> 

Received on Tuesday, 13 May 2014 14:11:40 UTC