Re: Float equality in OWL was: FYI fact++ bug?

On 7 Dec 2010, at 19:04, Alan Ruttenberg wrote:

> I asked Dmitry Tsarkov, developer of Fact++ about this and he says:
> "I'd like to remind you that any precise checks for the floating point
> datatypes looks should be avoided and considered
> implementation-defined."

?! This is madness. If the spec allows that we should change it. But I don' t think the spec allows that!

Equality and counting for Floats is precise.

> He will check it out when he has a chance.
> 
> The OWL Spec defers to XML Schema for this and most datatypes.
> http://www.w3.org/TR/xmlschema-2/#float
> 
> That spec says: A literal in the ·lexical space· representing a
> decimal number d maps to the normalized value in the ·value space· of
> float that is closest to d in the sense defined by [Clinger, WD
> (1990)]; if d is exactly halfway between two such values then the even
> value is chosen.
> 
> This looks well defined, though one could imagine a situation in which
> not all parties were parsing floats as specified leading to troubles.

But then one or both is nonconforming.

> I this case we have at least the code that parses manchester syntax in
> the interface and that parsing the OWL source involved.
> 
> I concur that the practice of depending on float equality can
> generally lead to errors,

Don't! This is one of the great myths promulgated about floats. Float equality is perfectly exact. The results of arithmetic operations on floats diverges from the corresponding operations on real numbers due to the inability to represent certain real numbers. But that can and is settled in a predicable way. 

> but I'm not sure whether Dmitry is correct
> in asserting that the results would be implementation independent.
> Anyone on OWL-DEV care to comment?
[snip]

He's totally and completely and utterly wrong as wrong mcwronginest wrongers can be wrong! C'mon, Dmitry!

Cheers,
Bijan.

Received on Tuesday, 7 December 2010 20:39:36 UTC