[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: [xacml] Numeric type conversion
Simon, Re numeric type conversion, please refer to XPath 2.0 draft. http://www.w3.org/TR/2002/WD-xpath20-20020816 Excerpt ============================================== B Type Promotion and Operator Mapping B.1 Type Promotion Under certain circumstances, an atomic value can be promoted from one type to another. The promotion rules listed below are used in basic type conversions (see 2.4.3 Type Conversions) and during processing of arithmetic expressions (see 3.4 Arithmetic Expressions) and value comparisons (see 3.5.1 Value Comparisons). The rules may be applied transitively. For example, since xs:integer is promotable to xs:decimal and xs:decimal is promotable to xs:float, it follows that xs:integer is promotable to xs:float, without necessarily passing through the intermediate xs:decimal type. The following type promotions are permitted: A value of type xs:decimal can be promoted to the type xs:float. The result is the xs:float value that is closest to the original value. A value of type xs:float can be promoted to the type xs:double. The result is the xs:double value that is the same as the original value. A value of a derived type can be promoted to its base type. The result is the base-type value that is the same as the original value. As an example of this rule, a value of the derived type xs:integer can be promoted to its base type xs:decimal. Michiharu Kudo IBM Tokyo Research Laboratory, Internet Technology Tel. +81 (46) 215-4642 Fax +81 (46) 273-7428
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC