Funkcja zaokrąglanie (XQuery)

Sum((xs:double(“INF”), xs:double(“-INF”))) zgłasza błąd domena.XQuery jest językiem zdecydowanie wpisany typy schematów i język słabo wpisane bez typu danych.Na przykład:

If the argument is 2.5, round() returns 3.

If the argument is 2.4999, round() returns 2.

If the argument is -2.5, round() returns -2.

Typy wbudowany schemat XML w http://www.w3.org/2001/XMLSchema obszar nazw.

fn:round ( $arg as numeric?) as numeric?

Argumenty

  • $arg
    Numer, do którego funkcja jest stosowana.

Remarks

If the type of $arg is one of the three numeric base types, xs:float, xs:double, or xs:decimal, the return type is same as the $arg type.If the type of $arg is a type that is derived from one of the numeric types, the return type is the base numeric type.

If input to the fn:floor, fn:ceiling, or fn:round functions is xdt:untypedAtomic, untyped data, it is implicitly cast to xs:double.

Każdy inny typ generuje błąd statyczny.

Przykłady

This topic provides XQuery examples against XML instances stored in various xml type columns in the AdventureWorks database.For an overview of these columns, see xml Data Type Representation in the AdventureWorks Database.

You can use the working sample in the ceiling function (XQuery) for the round() XQuery function.Niektóre z tych typów to xs:Integer and xs:ciąg .

defaultButton

Ograniczenia są następujące:

  • The round() function maps integer values to xs:decimal.

  • The round() function of xs:double and xs:float values between -0.5e0 and -0e0 are mapped to 0e0 instead of -0e0.