Lists Home |
Date Index |
At 02:43 PM 12/4/2002 -0500, Rich Salz wrote:
>I hope the following is concrete enough.
Yes - thanks for this! This is exactly the kind of concrete example I am
>Imagine the following element:
>(See http://www.joyofpi.com/pi.htm for details).
>Suppose you are building a web services front-end to Macsyma (or
>Mathematica). You might be tempted to add this attribute (assuming the
>"obvious" xmlns declarations)
>The problem is, that if you use something like DevStudio.Net and its
>wizards, you've guaranteed to have lost precision. That's a shame,
>because the math tool has effectively infinite precision, but my
>XML/WS/XSD tool artificially limits itself to IEEE floats because it
>thinks it's doing me a favor by making it trivial to generalize object
>serialization through XML.
Well, there's a problem you will encounter earlier. Float and double are
restricted to 32 and 64 bits respectively:
> [Definition:] float corresponds to the IEEE single-precision 32-bit
> floating point type [IEEE 754-1985].
> [Definition:] The double datatype corresponds to IEEE
> double-precision 64-bit floating point type [IEEE 754-1985].
That means that your document would not validate if you used these
datatypes. Of course, if you *did* use these datatypes, then a wizard could
make safe assumptions about precision, but your example precludes use of
There *is* a datatype that I could use to represent Pi to ten thousand
digits (or one million if I bought the book):
> [Definition:] decimal represents arbitrary precision decimal
If the document uses this datatype, then the Wizards had better be aware of
what the phrase "arbitrary precision" means. Using the datatype is a clear
warning to applications. Without the datatype, an application might
encounter decimals of very different sizes, but not be aware that arbitrary
precision numbers might arise until they encounter the first REALLLY BIG
Of course, you can write schemas that use decimals of fixed precision too.
In either case, the schema is explicit about the kinds of data applications
should be prepared to handle.
So isn't the use of datatypes more helpful than harmful in this case?