[tei-council] datatypes

Syd Bauman Syd_Bauman at Brown.edu
Wed Sep 21 14:37:16 EDT 2005


> >* tei.data.numeric: the change removes support for a constituency
> >  that we already now about: those who need to enter floating point
> >  numbers.
> >
> I thought we went through this on TEI-L, and someone like
> M Beddows showed that the W3C datatypes did do everything
> needed?

Well, yes, there are W3C datatypes for everything we need (or close
enough): xsd:long will handle any integer up to an enormous size, and
xsd:double will handle most any fraction and supports scientific
notation (thus supporting numbers that are larger than can be
represented with xsd:long). But these aren't what's in the tagdoc.
xsd:decimal is. 


> > Furthermore, I still claim it makes sense to permit
> >  percentages
> >
> at first blush, I think a percentage is like a dimension,
> not a numeric (width=23cm, width=88%). mixing
> it in with numeric seems pretty weird. I may well be wrong.

That is exactly the same as (width=23cm, width=0.88). In the first
case, you have a quantity ("23") and a unit ("cm"). In the second
case you have a quantity ("88%" or "0.88", same thing) and no unit.
88% of what? In the world of web widths, the implied unit is usually
"the width of the window".


> > (One could argue, though, that the percentages should be limited
> > to 8 characters maximum (effectively limiting them to 3 or 4
> > decimal places of precision), so that any tei.data.numeric value
> > could fit into 64 bits.)
> >
> haven't we gone beyond worrying about number of bits
> we use up?

I'm not sure it's worth the bother, but if I understand correctly
most common math subroutine libraries have trouble with > 64 bit
numbers (which is why xsd:long and xsd:double are 64 bit!). There
exist fancy math libraries for handling things like infinite
precision base-10 numbers (i.e., xsd:decimal or unlimited-digit
percentages). However, my understanding is that they are not as
readily available, not available in some languages, and not easy to
install & use on all systems. I don't know. The only one I've ever
tried to install & use took me about 4 minutes. (Can't remember its
name though ...)




More information about the tei-council mailing list