Created
May 5, 2011 10:24
-
-
Save xquery/956835 to your computer and use it in GitHub Desktop.
idiv operator in xquery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xquery version "1.0"; | |
| (: The idiv operator returns an integer as a result, rounding toward 0. :) | |
| let $a as xs:decimal := 20.1 | |
| let $b as xs:decimal := 1.678 | |
| let $result := $a idiv $b | |
| return | |
| $result | |
| (: the precise result is 11.978545887961859 but idiv returns 11 :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment