[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Syntax/matching rule implementation - floating point numbers

Lorenzo Pastrana writes:
> Don't expect too much from me until I get a little more experimented
> with OpenLDAP and its implementation.

Good luck.

> I'll be looking for some way of memcmp-arable real scalar encoding to
> see what's being done in networked games for example ...

Depending on your needs you could implement it without indexing support,
or at least with only EQUALITY indexing support.  No need for memcmpable
ordering.  Then add that later if you find you need to optimize.  An
index is just an optimization, plus it adds one bit of functionality
that I can think of: "sizelimit size.unchecked=<integer>" in slapd.conf.

A bit more reply-to-self to my previous message:

> You may want to normalize or prettify values received over the protocol
> before storing them, e.g. store incoming "nan" as "NaN".

Just to clarify, here I'm talking about the LDAP attribute syntax, not
the index format.

> For a non-normalized syntax, look at 'foo'='integer'.
> For a normalized index, look at 'foo'='generalizedTime'.

Sorry, "index" should be "syntax".

> Regarding a syntax for 'Real': (...) NaN is a problem. (...)

Duh, obviously the preferred thing as far as LDAP is concerned is to is
to copy whatever semantics REAL has in X.500.  Or some other ASN.1
floating point type, if there are several to choose from.  I don't know
if that fits your purpose, of course.  How to compare NaN, whether to
normalize "1.200" => "1.2", whether to store fixed or arbitrary
precision, etc.  Likely that says little about the textual syntax
though, since X.500 uses and transfers binary types.  The X.500 standard
is online at <http://www.x500standard.com/>, but it's pretty huge and
depends on ASN.1, which is to be found I-don't-remember where.
x500standard@freelists.org may be be best place to ask.