[jsdl-wg] (Param sweep) Proposed updated looping text
geoff
geoff.williams at comlab.ox.ac.uk
Mon Feb 23 10:04:55 CST 2009
Hi all,
In addition to the other requested specification modifications ("lay
dog"s and XPath 1+2) please take a look at the proposed looping
modifications.
Frustratingly one issue still remains: Dave Meredith has raised the
prospect of problems if we advise the use of ranges when performing
LoopDouble Exception comparison as effectively it's a green light for
inconsistency across implementations (and in some respects
mismatching/inaccuracy). As we're strongly recommending the adoption of
the IEEE 754 standard decimal floating point arithmetic in
implementations I think that this should provide the expected
consistency (even if it's consistent inaccuracy!?) without the need for
ranges. Alternatively a reversal on my earlier hesitation in the
adoption of the jsdl:RangeValue_Type may be required, e.g.
> <sweepfunc:LoopDouble substitutes=”sweep:Function”
> start=”xsd:double”
> end=”xsd:double”
> step=”xsd:double” >
> <sweepfunc:Exception> jsdl:RangeValue_Type </sweepfunc:Exception>*
> </sweepfunc:LoopDouble>
gef
------------------------------------------
4.2 LoopInteger function
The LoopInteger function provides an ordered list of integer values
within the inclusive range specified by the start and end values. The
list begins at the start value and contains all subsequent rangebound
incremented or decremented values as determined by the step value.
A LoopInteger function MAY exclude certain values by including Exception
Child elements.
This function yields values that are calculated as follows. The first
value equals the value of the start value. Any subsequent value is
calculated using the following rule:
nextValue ::= currentValue + valueOf( step )
If “nextValue” is beyond the range boundary specified by the end value,
then “nextValue” is discarded and the LoopInteger function terminates
with “currentValue”. If a value for “step” is not given, the default
value of “1” MUST be used.
... [unmodified]
Implementations handling the LoopInteger function may choose to :
- Where possible, predetermine and validate the loop cardinality by
inspection prior to running the loop operation, and confirm cardinality
post-operation.
- Respond appropriately if schematically valid yet questionable
values are supplied, e.g. if the value 0 is encountered for step.
... [unmodified]
4.3 LoopDouble function
The LoopDouble function provides an ordered list of double datatype
values (corresponding to the IEEE double-precision 64-bit floating point
type) within the inclusive range specified by the start and end values.
The list begins at the start value and contains all subsequent
rangebound incremented or decremented values as determined by the step
value.
... [unmodified]
The permissible value range...
....The following are therefore considered valid xsd:double values :
-1E4, 1267.43233E12, 12.78e-2, 12, NaN, -0 and INF .
Please note (accuracy advice): The reference to xsd:double datatype
values (and double-precision 64-bit floating point types) is solely for
the definition of the valid value range and format acceptable in
LoopDouble functions. Implementations which process such values should
have functionality that most accurately interprets and operates on such
a value range and format, e.g. it is strongly recommend that
implementations support IEEE 754 standard [1] decimal (base 10) floating
point arithmetic, in preference to binary (base 2) arithmetic.
Implementations handling the LoopDouble function may choose to :
- Where possible, predetermine and validate the loop cardinality by
inspection prior to running the loop operation, and confirm cardinality
post-operation.
- Convert xsd:double datatype values to integer values and implement
only integer arithmetic processing.
- Determine an acceptable range when comparing equality of a
particular loop value against loop Exception values, e.g. an exception
may be affirmed if a loop Exception value is within a % range of the
loop value.
- Encourage consistency in value format, e.g. avoid mixing scientific
and non-scientific nomenclature in a LoopDouble element.
- Respond appropriately should schematically valid yet questionable
values such as NaN, -0, INF, -INF be encountered.
Footer note:
[1] IEEE 754 - 2008 http://ieeexplore.ieee.org/servlet/opac?punumber=4610933
More information about the jsdl-wg
mailing list