W3C home > Mailing lists > Public > public-owl-wg@w3.org > July 2008

RE: ISSUE-126 (Revisit Datatypes): A new proposal for the real <-> float <-> double conundrum

From: Boris Motik <boris.motik@comlab.ox.ac.uk>
Date: Fri, 4 Jul 2008 16:18:12 +0100
To: "'Bijan Parsia'" <bparsia@cs.man.ac.uk>
Cc: "'OWL Working Group WG'" <public-owl-wg@w3.org>
Message-ID: <004401c8dde9$2cf6f640$7212a8c0@wolf>

Well, this might make determining the number of floats in a range easier. I still don't see the point in requiring people to do all
that, but let me first read the paper.

Boris

> -----Original Message-----
> From: Bijan Parsia [mailto:bparsia@cs.man.ac.uk]
> Sent: 04 July 2008 16:08
> To: Boris Motik
> Cc: 'OWL Working Group WG'
> Subject: Re: ISSUE-126 (Revisit Datatypes): A new proposal for the real <-> float <-> double
> conundrum
> 
> On 4 Jul 2008, at 15:18, Boris Motik wrote:
> [snip]
> > This ontology is unsatisfiable: the range of a:prop contains only
> > one object, but (4) requires existence of two different objects.
> > The difficulty in detecting this is that you need to count how many
> > numbers are there between n1 and n2. How are you going to do
> > that? The binary representation of floats is really cumbersome to
> > deal with.
> [snip]
> 
> I finally found a reasonable reference:
> 
> 	http://www.cygnus-software.com/papers/comparingfloats/
> comparingfloats.htm
> 
> """The IEEE float and double formats were designed so that the
> numbers are "lexicographically ordered", which - in the words of IEEE
> architect William Kahan means "if two floating-point numbers in the
> same format are ordered ( say x < y ), then they are ordered the same
> way when their bits are reinterpreted as Sign-Magnitude integers."
> 
> This means that if we take two floats in memory, interpret their bit
> pattern as integers, and compare them, we can tell which is larger,
> without doing a floating point comparison....
> 
> Because the floats are lexicographically ordered that means that if
> we increment the representation of a float as an integer then we move
> to the next float....
> 
> We can apply this logic in reverse also. If we subtract the integer
> representations of two floats then that will tell us how close they
> are. If the difference is zero, they are identical. If the difference
> is one, they are adjacent floats. In general, if the difference is n
> then there are n-1 floats between them. """
> 
> So you can map them to integers for counting purposes pretty easily.
> 
> Cheers,
> Bijan.
Received on Friday, 4 July 2008 15:19:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:42:05 UTC