OM Floats

David Carlisle davidc at
Tue Jul 6 17:32:45 CEST 1999

> At the risk of seeming both snippy and ignorable

Aha at last some discussion on the list. Things are improving!

> I find it difficult to get to meetings in Europe!)
> it is not clear if my input will register anywhere.

Well hopefully if this list starts being used rather than just being
dormant this requirement to travel to the Netherlands or Florida or ..
to find out what is happening will be reduced.

> Um, which representation did you have in mind? My recollection
> is that IEEE 754 doesn't specify a hex representation.  And
> is it for single, double,

double, and the `hex' is just used to express the bytes of the
ieee representation in a manner suitable for an XML documentation.

> Certainly no other language has needed hex to represent floating
> infinities

The OpenMath object itself just has the IEEE double.
In the binary encoding the bytes of that representation are stored
as is. In the XML encoding this may be encoded as <OMF dec=  or OMF hex= 
However the decimal representation for obvious reasons can not encode
the full range of values, which is why I commented that the hex
encoding may be used for NaN and friends.

> If we include arbitrary length integers, then arbitrary precision
> reals are encodable as (convert-to-real :value (rational x (^ 2 y))
>  :precision number-of-digits)    ;   using lisp key-word syntax.

Yes, another possibility.

> Since I'm not a member, you are free to ignore me.
Not really, a) I chose to post to om list rather than the om-memebers
list to encourage wider discussion, and b) you've been in this game
longer than most of us so probably it isn't wise to ignore you anyway:-)

> Since the double-precision semantics appears to be defective
> all by itself, I'm neutral on this.

Can you expand on this point. You may be misled because of the rather
selective way I quoted from the current draft, or there may be a real
problem that you are hightlighting, I can not tell.

In particular I am a bit confused by your comment

> At some point the real numbers
> 2.0
> and
> 1.99999999999999999999999999999999999999999999999999...
> become indistinguishable.  When does that happen?

as I thought that the main motivation for allowing arbitrary precision
real numbers was to ensure that for systems where it mattered, those
two, for any finite length of 9s would be distinguishable. This
behaviour would be distinct from the behaviour of the current
OMF which is a fixed double precision representation.

> I don't follow everything here, but unless you have specified
> algorithms for binary-to-decimal conversion, you haven't specified
> what any decimal encoding means, exactly

Which is a reasonable point. Since the libraries that exist do accept
floats in decimal representation, there does exist a defacto standard
algorithm that is being used, perhaps the standard should say what that


More information about the Om mailing list