[Os-project-managers] optional doubles with no default values

Horand Gassmann Horand.Gassmann at Dal.Ca
Fri Jan 28 05:45:54 EST 2011


Kipp Martin <kmartin at chicagobooth.edu> wrote:

> Hi Gus:
>
>
>> here is a follow-up question. Is it legal to say, e.g.,
>>
>> <initialVariableValues numberOfVar="1">
>>      <var idx="0" value="NaN">
>> </initialVariabeValues>
>
> Ugh, I should avoid opening your emails while eating supper.
>
> According to the schema
>
> <xs:attribute name="value" type="xs:double" use="optional"/>
>
> NaN is not a double. I thought that according to the IEEE standard, NaN
> values have the property that comparing them with a double should always
> be false. So value="Nan" strikes me as an Oxymoron and we should not
> allowed.

Yes, but... See, I try things. I thought I'd put in "NaN", just to see  
what happens. Since we can say

<initialVariableValues numberOfVar="1">
     <var idx="1">
</initialVariableValues>

and expect that to initial to NaN, it seems that the explicit version

<initialVariableValues numberOfVar="1">
     <var idx="1" value="NaN">
</initialVariableValues>

ought to work also, and it does. We read the attribute value in as a  
string and then do the conversion in code, which processes INF (has  
to) and NaN (also coded in there).

Now I grant you that in most situations we ought to reject "NaN". But  
for those four situations I identified yesterday (and probably for the  
OSrL files where I can see a solver tossing back a variable value of  
NaN in case an error occurred) we ought to allow it. I will have to  
scratch my head a bit about how I can test equality of two doubles in  
case of NaN. I think I have to do that, anyway.

Cheers

gus




More information about the Os-project-managers mailing list