Merge lp:~zorba-coders/zorba/bug-1189794-core into lp:zorba

Proposed by Chris Hillery
Status: Merged
Approved by: Luis Rodriguez Gonzalez
Approved revision: 11565
Merged at revision: 11557
Proposed branch: lp:~zorba-coders/zorba/bug-1189794-core
Merge into: lp:zorba
Diff against target: 4358 lines (+703/-731)
192 files modified
modules/CMakeLists.txt (+1/-1)
modules/atomic/CMakeLists.txt (+20/-0)
modules/atomic/math.xq (+423/-455)
modules/atomic/random.xq (+54/-50)
modules/base64/CMakeLists.txt (+0/-16)
modules/com/zorba-xquery/www/modules/CMakeLists.txt (+0/-4)
src/context/static_context.cpp (+2/-2)
src/functions/pregenerated/func_maths.cpp (+12/-12)
src/functions/pregenerated/func_random.cpp (+3/-3)
src/runtime/spec/mappings.xml (+2/-2)
test/rbkt/ExpQueryResults/zorba/random/seeded-random-between1.xml.res (+1/-1)
test/rbkt/Queries/zorba/annotations/annot-err-05.xq (+1/-1)
test/rbkt/Queries/zorba/annotations/annot-err-06.xq (+1/-1)
test/rbkt/Queries/zorba/annotations/annot-err-07.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_02.xq (+1/-1)
test/rbkt/Queries/zorba/math/acosh1.xq (+1/-1)
test/rbkt/Queries/zorba/math/asinh1.xq (+1/-1)
test/rbkt/Queries/zorba/math/atanh1.xq (+1/-1)
test/rbkt/Queries/zorba/math/cosh1.xq (+1/-1)
test/rbkt/Queries/zorba/math/cosh2.xq (+1/-1)
test/rbkt/Queries/zorba/math/deg-to-rad.xq (+1/-1)
test/rbkt/Queries/zorba/math/fmod1.xq (+1/-1)
test/rbkt/Queries/zorba/math/fmod2.xq (+1/-1)
test/rbkt/Queries/zorba/math/fmod3.xq (+1/-1)
test/rbkt/Queries/zorba/math/frexp1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.spec (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_ceiling4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_ceiling5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_ceiling6.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_even1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_even2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_even3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_even4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_fact4.spec (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_floor3.spec (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_floor4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_floor6.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_gcd4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_gcd5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.spec (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_int1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_int2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mode1.spec (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mround1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mround2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_mround4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_odd1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_odd2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_odd3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_odd4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.spec (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.spec (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_product1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_product2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_product3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.spec (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_rank1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_rank2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_rank3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_round1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_round2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_round3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_rounddown1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_rounddown2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_rounddown3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_rounddown4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_roundup1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_roundup2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_roundup3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_roundup4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_sign1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal4.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal5.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal6.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal7.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal8.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_subtotal9.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq (+1/-1)
test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq (+1/-1)
test/rbkt/Queries/zorba/math/is_inf1.xq (+1/-1)
test/rbkt/Queries/zorba/math/is_nan1.xq (+1/-1)
test/rbkt/Queries/zorba/math/ldexp1.xq (+1/-1)
test/rbkt/Queries/zorba/math/modf1.xq (+1/-1)
test/rbkt/Queries/zorba/math/sinh1.xq (+1/-1)
test/rbkt/Queries/zorba/math/tanh1.xq (+1/-1)
test/rbkt/Queries/zorba/random/random1.xq (+1/-1)
test/rbkt/Queries/zorba/random/seeded-random-between1.xq (+2/-2)
test/rbkt/Queries/zorba/random/seeded-random1.xq (+1/-1)
test/rbkt/Queries/zorba/random/uuid1.xq (+1/-1)
test/rbkt/Queries/zorba/random/uuid2.xq (+1/-1)
test/rbkt/Queries/zorba/reflection/reflection-invoke-10.xq (+2/-2)
test/rbkt/Queries/zorba/scripting/constr4.xq (+1/-1)
test/rbkt/Queries/zorba/string/AnalyzeString/http-client-doc.htm (+2/-2)
test/rbkt/Queries/zorba/xqxq/external-module.xq (+1/-1)
test/unit/invoke.cpp (+2/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1189794-core
Reviewer Review Type Date Requested Status
Luis Rodriguez Gonzalez Approve
Chris Hillery Approve
Review via email: mp+175224@code.launchpad.net

Commit message

Update core math and random modules to Zorba 3.0 standards.

To post a comment you must log in.
Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/bug-1189794-core/+merge/175224

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

11559. By Chris Hillery

More JSONifying - remove xs:, bareword true/false, etc.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting criteria failed for the following merge proposals:

https://code.launchpad.net/~zorba-coders/zorba/bug-1189794-core/+merge/175224 :
Votes: {'Approve': 1}

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/bug-1189794-core/+merge/175224

Stage "CommitZorba" failed.

Check console output at http://jenkins.lambda.nu/job/CommitZorba/39/console to view the results.

11560. By Chris Hillery

Update random module namespace URI.

11561. By Chris Hillery

JSONify random module.

11562. By Chris Hillery

Clean up XQDoc and error codes for random module.

11563. By Chris Hillery

s/INVALID_PARAMETER/INVALID_ARGUMENT/

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/bug-1189794-core/+merge/175224

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/bug-1189794-core/+merge/175224

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/bug-1189794-core/+merge/175224

Stage "TestZorbaUbuntu" failed.
14 tests failed (8355 total tests run).

Check test results at http://jenkins.lambda.nu/job/TestZorbaUbuntu/96/testReport/ to view the results.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting criteria failed for the following merge proposals:

https://code.launchpad.net/~zorba-coders/zorba/bug-1189794-core/+merge/175224 :
Votes: {'Approve': 1}

https://code.launchpad.net/~zorba-coders/zorba/bug-1189794-oauth/+merge/175236 :
Votes: {'Approve': 1}

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/bug-1189794-core/+merge/175224

Stage "CommitZorba" failed.

Check console output at http://jenkins.lambda.nu/job/CommitZorba/40/console to view the results.

11564. By Chris Hillery

Merge from trunk.

11565. By Chris Hillery

Move base64 module into atomic/ directory.

Revision history for this message
Luis Rodriguez Gonzalez (kuraru) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'modules/CMakeLists.txt'
--- modules/CMakeLists.txt 2013-07-17 07:20:31 +0000
+++ modules/CMakeLists.txt 2013-07-17 15:56:30 +0000
@@ -12,6 +12,7 @@
12# See the License for the specific language governing permissions and12# See the License for the specific language governing permissions and
13# limitations under the License.13# limitations under the License.
1414
15ADD_SUBDIRECTORY(atomic)
15ADD_SUBDIRECTORY(com)16ADD_SUBDIRECTORY(com)
16ADD_SUBDIRECTORY(org)17ADD_SUBDIRECTORY(org)
17ADD_SUBDIRECTORY(functx)18ADD_SUBDIRECTORY(functx)
@@ -20,7 +21,6 @@
20ADD_SUBDIRECTORY(full-text)21ADD_SUBDIRECTORY(full-text)
21ADD_SUBDIRECTORY(json)22ADD_SUBDIRECTORY(json)
22ADD_SUBDIRECTORY(nodes)23ADD_SUBDIRECTORY(nodes)
23ADD_SUBDIRECTORY(base64)
2424
25# Add external module projects - any subdirectories of a directory25# Add external module projects - any subdirectories of a directory
26# named "zorba_modules" as a sibling to the main Zorba source26# named "zorba_modules" as a sibling to the main Zorba source
2727
=== added directory 'modules/atomic'
=== added file 'modules/atomic/CMakeLists.txt'
--- modules/atomic/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ modules/atomic/CMakeLists.txt 2013-07-17 15:56:30 +0000
@@ -0,0 +1,20 @@
1# Copyright 2013 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15DECLARE_ZORBA_MODULE(FILE math.xq VERSION 1.0
16 URI "http://zorba.io/modules/math")
17DECLARE_ZORBA_MODULE(FILE random.xq VERSION 1.0
18 URI "http://zorba.io/modules/random")
19DECLARE_ZORBA_MODULE(FILE base64.xq VERSION 1.0
20 URI "http://zorba.io/modules/base64")
021
=== renamed file 'modules/base64/base64.xq' => 'modules/atomic/base64.xq'
=== renamed file 'modules/com/zorba-xquery/www/modules/math.xq' => 'modules/atomic/math.xq'
--- modules/com/zorba-xquery/www/modules/math.xq 2013-06-15 16:20:18 +0000
+++ modules/atomic/math.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1xquery version "3.0";1jsoniq version "1.0";
22
3(:3(:
4 : Copyright 2006-2009 The FLWOR Foundation.4 : Copyright 2006-2009 The FLWOR Foundation.
@@ -17,12 +17,12 @@
17:)17:)
1818
19(:~19(:~
20 : Extensive math library.20 : Extensive math library.<p/>
21 :21 :
22 : @author Daniel Turcanu, Dan Muresan22 : @author Daniel Turcanu, Dan Muresan
23 : @project Zorba/XQuery Data Model/Atomic/Math23 : @project Zorba/XQuery Data Model/Atomic/Math
24 :)24 :)
25module namespace math = "http://www.zorba-xquery.com/modules/math";25module namespace math = "http://zorba.io/modules/math";
2626
27(:~27(:~
28 : W3C Math namespace URI.28 : W3C Math namespace URI.
@@ -30,42 +30,23 @@
30declare namespace W3Cmath = "http://www.w3.org/2005/xpath-functions/math";30declare namespace W3Cmath = "http://www.w3.org/2005/xpath-functions/math";
3131
32declare namespace ver = "http://www.zorba-xquery.com/options/versioning";32declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
33declare option ver:module-version "2.0";33declare option ver:module-version "1.0";
3434
35(:~35declare %private variable $math:errNS as string := "http://zorba.io/modules/math";
36 : Errors namespace URI.36declare %private variable $math:VALUE_NOT_NUMERIC as QName := fn:QName($math:errNS, "math:VALUE_NOT_NUMERIC");
37:)37declare %private variable $math:INVALID_ARGUMENT as QName := fn:QName($math:errNS, "math:INVALID_ARGUMENT");
38declare variable $math:errNS as xs:string := "http://www.zorba-xquery.com/modules/math";38declare %private variable $math:DIVIDE_BY_0 as QName := fn:QName($math:errNS, "math:DIVIDE_BY_0");
3939declare %private variable $math:INVALID_INPUT as QName := fn:QName($math:errNS, "math:INVALID_INPUT");
40(:~40
41 : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/math" and local name "math:Value" 41
42:)42(:~
43declare variable $math:errValue as xs:QName := fn:QName($math:errNS, "math:Value");43 : Returns the hyperbolic cosine of x.<p/>
44
45(:~
46 : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/math" and local name "math:Num"
47:)
48declare variable $math:errNum as xs:QName := fn:QName($math:errNS, "math:Num");
49
50(:~
51 : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/math" and local name "math:Div0"
52:)
53declare variable $math:errDiv0 as xs:QName := fn:QName($math:errNS, "math:Div0");
54
55(:~
56 : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/math" and local name "math:NA"
57:)
58declare variable $math:errNA as xs:QName := fn:QName($math:errNS, "math:NA");
59
60
61(:~
62 : Returns the hyperbolic cosine of x.
63 : If the result it too large, INF is returned.44 : If the result it too large, INF is returned.
64 : 45 :
65 : @param $arg must be smaller than 7.104760e+00246 : @param $arg must be smaller than 7.104760e+002
66 : @return cosh(arg)47 : @return cosh(arg)
67 :)48 :)
68declare function math:cosh ($arg as xs:double) as xs:double external;49declare function math:cosh ($arg as double) as double external;
6950
70(:~51(:~
71 : Inverse hyperbolic cosine.52 : Inverse hyperbolic cosine.
@@ -73,7 +54,7 @@
73 : @param $arg the arg54 : @param $arg the arg
74 : @return the result of acosh(arg)55 : @return the result of acosh(arg)
75 :)56 :)
76declare function math:acosh ($arg as xs:double) as xs:double external;57declare function math:acosh ($arg as double) as double external;
7758
78(:~59(:~
79 : Function performing the modulo operation between the two arguments.60 : Function performing the modulo operation between the two arguments.
@@ -82,51 +63,51 @@
82 : @param $y the y63 : @param $y the y
83 : @return The remainder of x/y.64 : @return The remainder of x/y.
84 :)65 :)
85declare function math:fmod ($x as xs:double, $y as xs:double) as xs:double external;66declare function math:fmod ($x as double, $y as double) as double external;
8667
87(:~68(:~
88 : Returns the argument split as mantissa and exponent. 69 : Returns the argument split as mantissa and exponent.<p/>
89 : The recombining formula is (mantissa * 2^exponent).70 : The recombining formula is (mantissa * 2^exponent).
90 : 71 :
91 : @param $arg the double to be split.72 : @param $arg the double to be split.
92 : @return A sequence of two doubles (mantissa, exponent)73 : @return A sequence of two doubles (mantissa, exponent)
93 :)74 :)
94declare function math:frexp ($arg as xs:double) as xs:double+ external;75declare function math:frexp ($arg as double) as double+ external;
9576
96(:~77(:~
97 : Computes a real number from the mantissa and exponent.78 : Computes a real number from the mantissa and exponent.<p/>
98 : The formula is (x * 2^i).79 : The formula is (x * 2^i).
99 : 80 :
100 : @param $x the mantissa81 : @param $x the mantissa
101 : @param $i the exponent82 : @param $i the exponent
102 : @return the computed real number83 : @return the computed real number
103 :)84 :)
104declare function math:ldexp ($x as xs:double, $i as xs:integer) as xs:double external;85declare function math:ldexp ($x as double, $i as integer) as double external;
10586
106(:~87(:~
107 : Splits a floating-point value into fractional and integer parts.88 : Splits a floating-point value into fractional and integer parts.<p/>
108 : Both the fraction and integer keep the original sign of the value.89 : Both the fraction and integer keep the original sign of the value.
109 : 90 :
110 : @param $arg the double to be split.91 : @param $arg the double to be split.
111 : @return A sequence of two doubles (fraction, integer)92 : @return A sequence of two doubles (fraction, integer)
112 :)93 :)
113declare function math:modf ($arg as xs:double) as xs:double+ external;94declare function math:modf ($arg as double) as double+ external;
11495
115(:~96(:~
116 : Calculate hyperbolic sine.97 : Calculate the hyperbolic sine.
117 :98 :
118 : @param $arg the arg99 : @param $arg the arg
119 : @return the result of sinh(arg)100 : @return the result of sinh(arg)
120 :)101 :)
121declare function math:sinh ($arg as xs:double) as xs:double external;102declare function math:sinh ($arg as double) as double external;
122103
123(:~104(:~
124 : Inverse hyperbolic sine of the number.105 : Calculate the inverse hyperbolic sine.
125 :106 :
126 : @param $arg the arg107 : @param $arg the arg
127 : @return the result of asinh(arg)108 : @return the result of asinh(arg)
128 :)109 :)
129declare function math:asinh($arg as xs:double) as xs:double external;110declare function math:asinh($arg as double) as double external;
130111
131(:~112(:~
132 : Calculate the hyperbolic tangent.113 : Calculate the hyperbolic tangent.
@@ -134,7 +115,7 @@
134 : @param $arg the arg115 : @param $arg the arg
135 : @return the result of tanh(arg)116 : @return the result of tanh(arg)
136 :)117 :)
137declare function math:tanh($arg as xs:double) as xs:double external;118declare function math:tanh($arg as double) as double external;
138119
139(:~120(:~
140 : Calculate the hyperbolic tangent.121 : Calculate the hyperbolic tangent.
@@ -142,27 +123,27 @@
142 : @param $arg must be in range -1 ... +1 (exclusive)123 : @param $arg must be in range -1 ... +1 (exclusive)
143 : @return the result of atanh(arg)124 : @return the result of atanh(arg)
144 :)125 :)
145declare function math:atanh($arg as xs:double) as xs:double external;126declare function math:atanh($arg as double) as double external;
146127
147(:~128(:~
148 : Convert angle from degrees to radians. <br/>129 : Convert angle from degrees to radians. <p/>
149 : The parameter is first converted to value range of (-360, 360).130 : The parameter is first converted to value range of (-360, 360).
150 : 131 :
151 : @param $deg angle in degrees132 : @param $deg angle in degrees
152 : @return value in radians (-2PI, 2PI)133 : @return value in radians (-2PI, 2PI)
153 :)134 :)
154declare function math:deg-to-rad($deg as xs:double) as xs:double135declare function math:deg-to-rad($deg as double) as double
155{136{
156 ($deg mod 360) * 2 * W3Cmath:pi() div 360137 ($deg mod 360) * 2 * W3Cmath:pi() div 360
157};138};
158139
159(:~140(:~
160 : Convert angle from radians to degrees. <br/>141 : Convert angle from radians to degrees. <p/>
161 : 142 :
162 : @param $rad value in radians143 : @param $rad value in radians
163 : @return value in degrees (-360, 360)144 : @return value in degrees (-360, 360)
164 :)145 :)
165declare function math:rad-to-deg($rad as xs:double) as xs:double146declare function math:rad-to-deg($rad as double) as double
166{147{
167 ($rad * 360 div 2 div W3Cmath:pi()) mod 360148 ($rad * 360 div 2 div W3Cmath:pi()) mod 360
168};149};
@@ -173,7 +154,7 @@
173 : @param $arg the double to be checked154 : @param $arg the double to be checked
174 : @return boolean true if argument is pos INF or neg INF155 : @return boolean true if argument is pos INF or neg INF
175 :)156 :)
176declare function math:is_inf($arg as xs:double) as xs:boolean external;157declare function math:is_inf($arg as double) as boolean external;
177158
178(:~159(:~
179 : Checks if the double value is Not a Number (NaN).160 : Checks if the double value is Not a Number (NaN).
@@ -181,7 +162,7 @@
181 : @param $arg the arg162 : @param $arg the arg
182 : @return boolean true if the double is NaN163 : @return boolean true if the double is NaN
183 :)164 :)
184declare function math:is_nan($arg as xs:double) as xs:boolean external;165declare function math:is_nan($arg as double) as boolean external;
185166
186167
187168
@@ -189,58 +170,59 @@
189(:Excel math functions:)170(:Excel math functions:)
190171
191(:~172(:~
192 : Borrowed from excel module.<br/>173 : Checks if the anyAtomicType argument is actually a numeric type
193 : Checks if the xs:anyAtomicType argument is actually a numeric type174 : or can be converted to numeric.<p/>
194 : or can be converted to numeric.175 : Borrowed from excel module.
195 : 176 :
196 : @param $value Parameter to be checked.177 : @param $value Parameter to be checked.
197 : @return true if the value can be casted to numeric.178 : @return true if the value can be casted to numeric.
198 :)179 :)
199declare function math:is-a-number($value as xs:anyAtomicType) as xs:boolean 180declare function math:is-a-number($value as anyAtomicType) as boolean
200{ 181{
201 fn:string(fn:number($value)) ne 'NaN' 182 fn:string(fn:number($value)) ne "NaN"
202};183};
203184
204(:~185(:~
205 : Borrowed from excel module.<br/>186 : Cast the anyAtomicType to a numeric type.<p/>
206 : Cast the xs:anyAtomicType to a numeric type.
207 : If the value is already of a numeric type then nothing is changed.187 : If the value is already of a numeric type then nothing is changed.
208 : Otherwise the value is casted to the numeric type that is most appropriate.188 : Otherwise the value is casted to the numeric type that is most appropriate.
189 : <p/>
190 : Borrowed from excel module.
209 : 191 :
210 : @param $number The parameter can be a number, string, boolean value.192 : @param $number The parameter can be a number, string, boolean value.
211 : @return The casted value.193 : @return The casted value.
212 : @error math:errValue if the value cannot be casted to numeric type.194 : @error math:VALUE_NOT_NUMERIC if the value cannot be casted to numeric type.
213 :)195 :)
214declare function math:cast-as-numeric($number as xs:anyAtomicType) as xs:anyAtomicType196declare function math:cast-as-numeric($number as anyAtomicType) as anyAtomicType
215{197{
216 typeswitch ($number) 198 typeswitch ($number)
217 case xs:double return $number199 case double return $number
218 case xs:decimal return $number200 case decimal return $number
219 case xs:double return $number201 case double return $number
220 case xs:float return $number202 case float return $number
221 default return203 default return
222 if ($number castable as xs:integer) then204 if ($number castable as integer) then
223 xs:integer($number)205 integer($number)
224 else if ($number castable as xs:decimal) then206 else if ($number castable as decimal) then
225 xs:decimal($number)207 decimal($number)
226 else if ($number castable as xs:double) then208 else if ($number castable as double) then
227 xs:double($number)209 double($number)
228 else210 else
229 fn:error($math:errValue, "Provided value is not a number", $number)211 fn:error($math:VALUE_NOT_NUMERIC, "Provided value is not a number", $number)
230};212};
231213
232(:~214(:~
233 : Borrowed from excel module.<br/>215 : Returns number rounded up, away from zero, to the nearest multiple of significance.<p/>
234 : Returns number rounded up, away from zero, to the nearest multiple of significance.
235 : Significance must have the same sign as number.216 : Significance must have the same sign as number.
236 : Number and significance must be of a numeric type or castable to numeric.217 : Number and significance must be of a numeric type or castable to numeric.
237 : Significance must not be zero.218 : Significance must not be zero.<p/>
219 : Borrowed from excel module.
238 : 220 :
239 : @see http://office.microsoft.com/en-us/excel/HP052090071033.aspx221 : @see http://office.microsoft.com/en-us/excel/HP052090071033.aspx
240 : @param $number The value you want to round.222 : @param $number The value you want to round.
241 : @param $significance The multiple to which you want to round.223 : @param $significance The multiple to which you want to round.
242 : @return The rounded value.224 : @return The rounded value.
243 : @error math:errNum if significance is zero or it doesn't have the same sign as number.225 : @error math:INVALID_ARGUMENT if significance is zero or it doesn't have the same sign as number.
244 : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq226 : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq
245 : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq227 : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq
246 : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq228 : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq
@@ -250,21 +232,21 @@
250 : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq232 : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq
251 :)233 :)
252declare function math:ceiling(234declare function math:ceiling(
253 $number as xs:double,235 $number as double,
254 $significance as xs:double) as xs:double236 $significance as double) as double
255{237{
256 if ($significance eq 0) then238 if ($significance eq 0) then
257 fn:error($math:errNum, "Ceiling function does not accept significance 0")239 fn:error($math:INVALID_ARGUMENT, "Ceiling function does not accept significance 0")
258 else if ($number * $significance ge 0) then240 else if ($number * $significance ge 0) then
259 fn:ceiling($number div $significance) * $significance241 fn:ceiling($number div $significance) * $significance
260 else242 else
261 fn:error($math:errNum, "Ceiling function: both arguments must have the same sign")243 fn:error($math:INVALID_ARGUMENT, "Ceiling function: both arguments must have the same sign")
262};244};
263245
264(:~246(:~
265 : Borrowed from excel module.<br/>247 : Returns number rounded up to the nearest even integer.<p/>
266 : Returns number rounded up to the nearest even integer.248 : Regardless of the sign of number, a value is rounded up when adjusted away from zero.<p/>
267 : Regardless of the sign of number, a value is rounded up when adjusted away from zero. 249 : Borrowed from excel module.
268 : 250 :
269 : @see http://office.microsoft.com/en-us/excel/HP052090801033.aspx251 : @see http://office.microsoft.com/en-us/excel/HP052090801033.aspx
270 : @param $number The value to round.252 : @param $number The value to round.
@@ -276,14 +258,14 @@
276 : @example test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq258 : @example test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq
277 : @example test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq259 : @example test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq
278 :)260 :)
279declare function math:even($number as xs:double) as xs:integer261declare function math:even($number as double) as integer
280{262{
281 let $num := $number263 let $num := $number
282 return264 return
283 if ($num = 0) then265 if ($num eq 0) then
284 0266 0
285 else267 else
286 let $intnum := xs:integer(math:ceiling($num, math:sign($num)))268 let $intnum := integer(math:ceiling($num, math:sign($num)))
287 return269 return
288 if ($intnum mod 2 ne 0) then270 if ($intnum mod 2 ne 0) then
289 if ($intnum gt 0) then271 if ($intnum gt 0) then
@@ -295,58 +277,57 @@
295};277};
296278
297(:~279(:~
280 : Function for computing factorial.<p/>
281 : This recursive function computes: number * fact(number-1)<p/>
298 : Borrowed from excel module.<br/>282 : Borrowed from excel module.<br/>
299 : Function for computing factorial.
300 : This function should not be used outside this module.
301 : This recursive function computes: number * fact(number-1)
302 : 283 :
303 : @param $intnum A positive integer.284 : @param $intnum A positive integer.
304 : @return The factorial of intnum.285 : @return The factorial of intnum.
305:)286:)
306declare %private function math:fact-integer($intnum as xs:integer) as xs:integer287declare %private function math:fact-integer($intnum as integer) as integer
307{288{
308 if ($intnum = 1) then289 if ($intnum eq 1) then
309 1290 1
310 else291 else
311 $intnum * math:fact-integer($intnum - 1)292 $intnum * math:fact-integer($intnum - 1)
312};293};
313294
314(:~295(:~
315 : Borrowed from excel module.<br/>296 : Returns the factorial of a number.<p/>
316 : Returns the factorial of a number.297 : Borrowed from excel module.
317 : 298 :
318 : @see http://office.microsoft.com/en-us/excel/HP052090841033.aspx299 : @see http://office.microsoft.com/en-us/excel/HP052090841033.aspx
319 : @param $number The non-negative number you want the factorial of.300 : @param $number The non-negative number you want the factorial of.
320 : @return Returns the factorial of a number. The factorial of a number is equal to 1*2*3*...* number.301 : @return Returns the factorial of a number. The factorial of a number is equal to 1*2*3*...* number.
321 : @error math:errNum if the number is smaller than zero302 : @error math:INVALID_ARGUMENT if the number is smaller than zero
322 : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq303 : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq
323 : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq304 : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq
324 : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq305 : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq
325 : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq306 : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq
326 : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq307 : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq
327:)308:)
328declare function math:fact($number as xs:integer) as xs:integer309declare function math:fact($number as integer) as integer
329{310{
330 let $num := $number return311 let $num := $number return
331 if ($num eq 0) then312 if ($num eq 0) then
332 1313 1
333 else314 else
334 if ($num lt 0) then315 if ($num lt 0) then
335 fn:error($math:errNum, "Fact function does not accept numbers smaller than zero")316 fn:error($math:INVALID_ARGUMENT, "Fact function does not accept numbers smaller than zero")
336 else317 else
337 math:fact-integer(xs:integer($num))318 math:fact-integer(integer($num))
338};319};
339320
340(:~321(:~
341 : Borrowed from excel module.<br/>322 : Rounds number down, toward zero, to the nearest multiple of significance.<p/>
342 : Rounds number down, toward zero, to the nearest multiple of significance.
343 : Significance must have the same sign as number.323 : Significance must have the same sign as number.
324 : Borrowed from excel module.
344 : 325 :
345 : @see http://office.microsoft.com/en-us/excel/HP052090941033.aspx326 : @see http://office.microsoft.com/en-us/excel/HP052090941033.aspx
346 : @param $number The value you want to round. 327 : @param $number The value you want to round.
347 : @param $significance The multiple to which you want to round.328 : @param $significance The multiple to which you want to round.
348 : @return The rounded value as numeric type.329 : @return The rounded value as numeric type.
349 : @error math:errNum if significance is zero or it doesn't have the same sign as number.330 : @error math:INVALID_ARGUMENT if significance is zero or it doesn't have the same sign as number.
350 : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq331 : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq
351 : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq332 : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq
352 : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq333 : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq
@@ -354,24 +335,24 @@
354 : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq335 : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq
355:)336:)
356declare function math:floor(337declare function math:floor(
357 $number as xs:double,338 $number as double,
358 $significance as xs:double) as xs:double339 $significance as double) as double
359{340{
360 let $num := $number341 let $num := $number
361 let $sig := $significance342 let $sig := $significance
362 return343 return
363 if ($sig eq 0) then344 if ($sig eq 0) then
364 fn:error($math:errNum, "Floor function does not accept significance 0")345 fn:error($math:INVALID_ARGUMENT, "Floor function does not accept significance 0")
365 else if ($num * $sig ge 0) then346 else if ($num * $sig ge 0) then
366 fn:floor($num div $sig) * $sig347 fn:floor($num div $sig) * $sig
367 else348 else
368 fn:error($math:errNum, "Floor function: both arguments must have the same sign")349 fn:error($math:INVALID_ARGUMENT, "Floor function: both arguments must have the same sign")
369};350};
370 351
371(:~352(:~
372 : Borrowed from excel module.<br/>353 : Rounds a number down to the nearest integer.<p/>
373 : Rounds a number down to the nearest integer.354 : Positive numbers are rounded toward zero, negative numbers are rounded away from zero.<p/>
374 : Positive numbers are rounded toward zero, negative numbers are rounded away from zero.355 : Borrowed from excel module.
375 : 356 :
376 : @see http://office.microsoft.com/en-us/excel/HP052091421033.aspx357 : @see http://office.microsoft.com/en-us/excel/HP052091421033.aspx
377 : @param $number The value to be rounded.358 : @param $number The value to be rounded.
@@ -381,35 +362,35 @@
381 : @example test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq362 : @example test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq
382 : @example test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq363 : @example test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq
383:)364:)
384declare function math:int($number as xs:double) as xs:integer365declare function math:int($number as double) as integer
385{366{
386 xs:integer(fn:floor($number))367 integer(fn:floor($number))
387};368};
388369
389(:~370(:~
390 : Borrowed from excel module.<br/>371 : Returns the remainder after number is divided by divisor.<p/>
391 : Returns the remainder after number is divided by divisor.372 : The result has the same sign as divisor.<p/>
392 : The result has the same sign as divisor.373 : Borrowed from excel module.
393 : 374 :
394 : @see http://office.microsoft.com/en-us/excel/HP052091821033.aspx375 : @see http://office.microsoft.com/en-us/excel/HP052091821033.aspx
395 : @param $number The number for which you want to find the remainder.376 : @param $number The number for which you want to find the remainder.
396 : @param $divisor The number by which you want to divide number.377 : @param $divisor The number by which you want to divide number.
397 : This cannot be zero.378 : This cannot be zero.
398 : @return The remainder from division as numeric type.379 : @return The remainder from division as numeric type.
399 : @error math:errDiv0 if divisor is zero after casting to numeric.380 : @error math:DIVIDE_BY_0 if divisor is zero after casting to numeric.
400 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq381 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq
401 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq382 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq
402 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq383 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq
403 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq384 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq
404 :)385 :)
405declare function math:mod(386declare function math:mod(
406 $number as xs:double,387 $number as double,
407 $divisor as xs:double) as xs:double388 $divisor as double) as double
408{389{
409 let $num := $number390 let $num := $number
410 let $div := $divisor return391 let $div := $divisor return
411 if ($div eq 0) then392 if ($div eq 0) then
412 fn:error($math:errDiv0, "Mod operator: divide by 0")393 fn:error($math:DIVIDE_BY_0, "Mod operator: divide by 0")
413 else394 else
414 let $result := $num mod $div395 let $result := $num mod $div
415 return396 return
@@ -420,8 +401,8 @@
420};401};
421 402
422(:~403(:~
423 : Borrowed from excel module.<br/>404 : Returns number rounded up to the nearest odd integer, away from zero.<p/>
424 : Returns number rounded up to the nearest odd integer, away from zero.405 : Borrowed from excel module.
425 : 406 :
426 : @see http://office.microsoft.com/en-us/excel/HP052092031033.aspx407 : @see http://office.microsoft.com/en-us/excel/HP052092031033.aspx
427 : @param $number The value to round.408 : @param $number The value to round.
@@ -433,33 +414,32 @@
433 : @example test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq414 : @example test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq
434 : @example test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq415 : @example test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq
435 :)416 :)
436declare function math:odd($number as xs:double) as xs:integer417declare function math:odd($number as double) as integer
437{418{
438 let $num := $number return419 let $num := $number return
439 if ($num eq 0) then420 if ($num eq 0) then
440 1421 1
441 else422 else
442 let $intnum := xs:integer(math:ceiling($num, math:sign($num)))423 let $intnum := integer(math:ceiling($num, math:sign($num)))
443 return424 return
444 if ($intnum mod 2 eq 0) then425 if ($intnum mod 2 eq 0) then
445 if ($intnum ge 0) then426 if ($intnum ge 0) then
446 ($intnum + 1) cast as xs:integer427 ($intnum + 1) cast as integer
447 else428 else
448 ($intnum - 1) cast as xs:integer429 ($intnum - 1) cast as integer
449 else430 else
450 $intnum cast as xs:integer431 $intnum cast as integer
451};432};
452 433
453(:~434(:~
454 : Borrowed from excel module.<br/>435 : Function for product.<p/>
455 : Function for product.436 : Multiplies all numbers in the sequence.<p/>
456 : This function should not be used outside this module.437 : Borrowed from excel module.
457 : Multiplies all numbers in the sequence.
458 :438 :
459 : @param $numbers The list of arguments to be casted to numeric and multiplied.439 : @param $numbers The list of arguments to be casted to numeric and multiplied.
460 : @return The multiplication result as numeric type.440 : @return The multiplication result as numeric type.
461 :)441 :)
462declare %private function math:product-internal($numbers as xs:double*) as xs:double442declare %private function math:product-internal($numbers as double*) as double
463{443{
464 if (fn:empty($numbers)) then444 if (fn:empty($numbers)) then
465 1445 1
@@ -470,8 +450,8 @@
470};450};
471 451
472(:~452(:~
473 : Borrowed from excel module.<br/>453 : Multiplies all the numbers given as arguments and returns the product.<p/>
474 : Multiplies all the numbers given as arguments and returns the product.454 : Borrowed from excel module.
475 : 455 :
476 : @see http://office.microsoft.com/en-us/excel/HP052092231033.aspx456 : @see http://office.microsoft.com/en-us/excel/HP052092231033.aspx
477 : @param $numbers The sequence of arguments convertible to numeric types.457 : @param $numbers The sequence of arguments convertible to numeric types.
@@ -483,7 +463,7 @@
483 : @example test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq463 : @example test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq
484 : @example test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq464 : @example test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq
485 :)465 :)
486declare function math:product($numbers as xs:double*) as xs:double466declare function math:product($numbers as double*) as double
487{467{
488 if (fn:empty($numbers)) then468 if (fn:empty($numbers)) then
489 0469 0
@@ -492,40 +472,40 @@
492};472};
493 473
494(:~474(:~
495 : Borrowed from excel module.<br/>475 : Returns the integer portion of a division.<p/>
496 : Returns the integer portion of a division.476 : Borrowed from excel module.
497 : 477 :
498 : @see http://office.microsoft.com/en-us/excel/HP052092271033.aspx478 : @see http://office.microsoft.com/en-us/excel/HP052092271033.aspx
499 : @param $numerator The divider.479 : @param $numerator The divider.
500 : @param $denominator The divisor. It cannot be zero.480 : @param $denominator The divisor. It cannot be zero.
501 : @return The result value as numeric type.481 : @return The result value as numeric type.
502 : @error math:errDiv0 if denominator casted as numeric type has value zero.482 : @error math:DIVIDE_BY_0 if denominator casted as numeric type has value zero.
503 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq483 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq
504 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq484 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq
505 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq485 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq
506 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq486 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq
507 :)487 :)
508declare function math:quotient(488declare function math:quotient(
509 $numerator as xs:double,489 $numerator as double,
510 $denominator as xs:double) as xs:integer490 $denominator as double) as integer
511{491{
512 let $numer := $numerator492 let $numer := $numerator
513 let $denom := $denominator493 let $denom := $denominator
514 return494 return
515 if ($denom eq 0) then495 if ($denom eq 0) then
516 fn:error($math:errDiv0, "Quotient function: divide by 0")496 fn:error($math:DIVIDE_BY_0, "Quotient function: divide by 0")
517 else497 else
518 xs:integer($numer div $denom)498 integer($numer div $denom)
519};499};
520 500
521(:~501(:~
522 : Borrowed from excel module.<br/>502 : Rounds a number to a specified number of digits.<p/>
523 : Rounds a number to a specified number of digits.
524 : If precision is greater than 0 (zero), then number is rounded 503 : If precision is greater than 0 (zero), then number is rounded
525 : to the specified number of decimal places.504 : to the specified number of decimal places.
526 : If num_digits is 0, then number is rounded to the nearest integer.505 : If num_digits is 0, then number is rounded to the nearest integer.
527 : If num_digits is less than 0, then number is rounded to the left of the decimal point.506 : If num_digits is less than 0, then number is rounded to the left of the decimal point.
528 : The 0.5 is rounded away from zero. 507 : The 0.5 is rounded away from zero. <p/>
508 : Borrowed from excel module.
529 : 509 :
530 : @see http://office.microsoft.com/en-us/excel/HP052092391033.aspx510 : @see http://office.microsoft.com/en-us/excel/HP052092391033.aspx
531 : @param $number The number to round.511 : @param $number The number to round.
@@ -537,8 +517,8 @@
537 : @example test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq517 : @example test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq
538 :)518 :)
539declare function math:round(519declare function math:round(
540 $number as xs:double,520 $number as double,
541 $precision as xs:integer) as xs:double521 $precision as integer) as double
542{522{
543 let $num := $number523 let $num := $number
544 return524 return
@@ -559,12 +539,12 @@
559};539};
560 540
561(:~541(:~
562 : Borrowed from excel module.<br/>542 : Rounds a number down, toward zero.<p/>
563 : Rounds a number down, toward zero.
564 : If num_digits is greater than 0 (zero), then number is rounded down 543 : If num_digits is greater than 0 (zero), then number is rounded down
565 : to the specified number of decimal places. 544 : to the specified number of decimal places.
566 : If num_digits is 0, then number is rounded down to the nearest integer. 545 : If num_digits is 0, then number is rounded down to the nearest integer.
567 : If num_digits is less than 0, then number is rounded down to the left of the decimal point. 546 : If num_digits is less than 0, then number is rounded down to the left of the decimal point. <p/>
547 : Borrowed from excel module.
568 : 548 :
569 : @see http://office.microsoft.com/en-us/excel/HP052092411033.aspx549 : @see http://office.microsoft.com/en-us/excel/HP052092411033.aspx
570 : @param $number The number to round550 : @param $number The number to round
@@ -577,8 +557,8 @@
577 : @example test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq557 : @example test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq
578 :)558 :)
579declare function math:rounddown(559declare function math:rounddown(
580 $number as xs:double,560 $number as double,
581 $precision as xs:integer) as xs:double561 $precision as integer) as double
582{562{
583 let $num := $number563 let $num := $number
584 return564 return
@@ -599,12 +579,12 @@
599};579};
600 580
601(:~581(:~
602 : Borrowed from excel module.<br/>582 : Rounds a number up, away from 0 (zero).<p/>
603 : Rounds a number up, away from 0 (zero).
604 : If num_digits is greater than 0 (zero), then number is rounded down 583 : If num_digits is greater than 0 (zero), then number is rounded down
605 : to the specified number of decimal places. 584 : to the specified number of decimal places.
606 : If num_digits is 0, then number is rounded down to the nearest integer. 585 : If num_digits is 0, then number is rounded down to the nearest integer.
607 : If num_digits is less than 0, then number is rounded down to the left of the decimal point. 586 : If num_digits is less than 0, then number is rounded down to the left of the decimal point. <p/>
587 : Borrowed from excel module.
608 : 588 :
609 : @see http://office.microsoft.com/en-us/excel/HP052092421033.aspx589 : @see http://office.microsoft.com/en-us/excel/HP052092421033.aspx
610 : @param $number The number to round590 : @param $number The number to round
@@ -617,8 +597,8 @@
617 : @example test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq597 : @example test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq
618 :)598 :)
619declare function math:roundup(599declare function math:roundup(
620 $number as xs:double,600 $number as double,
621 $precision as xs:integer) as xs:double601 $precision as integer) as double
622{602{
623 let $num := $number603 let $num := $number
624 return604 return
@@ -639,10 +619,10 @@
639};619};
640 620
641(:~621(:~
642 : Borrowed from excel module.<br/>622 : Determines the sign of a number. <p/>
643 : Determines the sign of a number.
644 : Returns 1 if the number is positive, zero (0) if the number is 0, 623 : Returns 1 if the number is positive, zero (0) if the number is 0,
645 : and -1 if the number is negative.624 : and -1 if the number is negative.<p/>
625 : Borrowed from excel module.
646 : 626 :
647 : @see http://office.microsoft.com/en-us/excel/HP052092551033.aspx627 : @see http://office.microsoft.com/en-us/excel/HP052092551033.aspx
648 : @param $number The argument628 : @param $number The argument
@@ -651,7 +631,7 @@
651 : @example test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq631 : @example test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq
652 : @example test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq632 : @example test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq
653 :)633 :)
654declare function math:sign($number as xs:double) as xs:integer634declare function math:sign($number as double) as integer
655{635{
656 let $num := $number636 let $num := $number
657 return637 return
@@ -664,8 +644,8 @@
664 };644 };
665645
666(:~646(:~
667 : Borrowed from excel module.<br/>647 : Truncates a number to an integer by removing the fractional part of the number.<p/>
668 : Truncates a number to an integer by removing the fractional part of the number.648 : Borrowed from excel module.
669 : 649 :
670 : @see http://office.microsoft.com/en-us/excel/HP052093241033.aspx650 : @see http://office.microsoft.com/en-us/excel/HP052093241033.aspx
671 : @param $number The argument .651 : @param $number The argument .
@@ -673,15 +653,15 @@
673 : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq653 : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq
674 : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq654 : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq
675 :)655 :)
676declare function math:trunc($number as xs:double ) as xs:integer656declare function math:trunc($number as double ) as integer
677{657{
678 xs:integer($number)658 integer($number)
679};659};
680 660
681(:~661(:~
682 : Borrowed from excel module.<br/>662 : Truncates a number down to precision.<p/>
683 : Truncates a number down to precision.663 : This behaves exactly like rounddown.<p/>
684 : This behaves exactly like rounddown.664 : Borrowed from excel module.
685 : 665 :
686 : @see http://office.microsoft.com/en-us/excel/HP052093241033.aspx666 : @see http://office.microsoft.com/en-us/excel/HP052093241033.aspx
687 : @param $number The argument castable to numeric type.667 : @param $number The argument castable to numeric type.
@@ -690,22 +670,22 @@
690 : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq670 : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq
691 :)671 :)
692declare function math:trunc(672declare function math:trunc(
693 $number as xs:double,673 $number as double,
694 $precision as xs:integer) as xs:double674 $precision as integer) as double
695{675{
696 math:rounddown($number, $precision)676 math:rounddown($number, $precision)
697};677};
698 678
699(:~679(:~
700 : Borrowed from excel module.<br/>680 : Sorts a sequence of numbers or arguments castable to numeric.<p/>
681 : It first casts all arguments to numeric and then sorts ascending.<p/>
701 : Helper function.<br/>682 : Helper function.<br/>
702 : Sorts a sequence of numbers or arguments castable to numeric.683 : Borrowed from excel module.
703 : It first casts all arguments to numeric and then sorts ascending.
704 : 684 :
705 : @param $numbers The sequence of arguments castable to numeric.685 : @param $numbers The sequence of arguments castable to numeric.
706 : @return The sorted sequence as numeric types.686 : @return The sorted sequence as numeric types.
707 :)687 :)
708declare function math:sort-numbers($numbers as xs:double*) as xs:double*688declare function math:sort-numbers($numbers as double*) as double*
709{689{
710 let $sorted-numbers :=690 let $sorted-numbers :=
711 (691 (
@@ -718,21 +698,21 @@
718};698};
719699
720(:~700(:~
721 : Borrowed from excel module.<br/>701 : Returns the double factorial of a number.<p/>
722 : Returns the double factorial of a number.702 : Computes the double factorial of n as n(n-2)(n-4)...<p/>
723 : Computes the double factorial of n as n(n-2)(n-4)...703 : Borrowed from excel module.
724 : 704 :
725 : @see http://office.microsoft.com/en-us/excel/HP052090851033.aspx705 : @see http://office.microsoft.com/en-us/excel/HP052090851033.aspx
726 : @param $number The positive integer value.706 : @param $number The positive integer value.
727 : @return The result as integer.707 : @return The result as integer.
728 : @error math:errNum if the number is negative.708 : @error math:INVALID_ARGUMENT if the number is negative.
729 : @example test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq709 : @example test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq
730 : @example test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq710 : @example test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq
731 :)711 :)
732declare function math:factdouble($number as xs:integer) as xs:integer712declare function math:factdouble($number as integer) as integer
733{713{
734 if ($number lt 0) then714 if ($number lt 0) then
735 fn:error($math:errNum, "Factdouble function: number should be greater than zero or equal")715 fn:error($math:INVALID_ARGUMENT, "Factdouble function: number should be greater than zero or equal")
736 else if ($number eq 1) then716 else if ($number eq 1) then
737 1717 1
738 else if ($number eq 2) then718 else if ($number eq 2) then
@@ -742,16 +722,15 @@
742};722};
743723
744(:~724(:~
745 : Borrowed from excel module.<br/>725 : Function for computing GCD.<p/>
746 : Function for computing GCD.
747 : This function should not be used outside this module.
748 : It calculates the minimum value from a sequence of positive integers, 726 : It calculates the minimum value from a sequence of positive integers,
749 : not taking into account the zero value.727 : not taking into account the zero value.<p/>
728 : Borrowed from excel module.
750 : 729 :
751 : @param $numbers The sequence of positive integers.730 : @param $numbers The sequence of positive integers.
752 : @return The minimum value. If the sequence contains only zero values, then zero is returned.731 : @return The minimum value. If the sequence contains only zero values, then zero is returned.
753 :)732 :)
754declare %private function math:min-without-zero($numbers as xs:integer+) as xs:integer733declare %private function math:min-without-zero($numbers as integer+) as integer
755{734{
756 if (fn:count($numbers) eq 1) then735 if (fn:count($numbers) eq 1) then
757 $numbers[1]736 $numbers[1]
@@ -769,36 +748,33 @@
769};748};
770749
771(:~750(:~
772 : Borrowed from excel module.<br/>751 : Function for computing GCD.<p/>
773 : Function for computing GCD.752 : Checks if all integer numbers from a sequence divide exactly to a divider.<p/>
774 : This function should not be used outside this module.753 : Borrowed from excel module.
775 : Checks if all integer numbers from a sequence divide exactly to a divider.
776 :754 :
777 : @param $numbers The positive integers.755 : @param $numbers The positive integers.
778 : @param $divider The divider to be tried.756 : @param $divider The divider to be tried.
779 : @return true if the numbers divide exactly.757 : @return true if the numbers divide exactly.
780:)758:)
781declare %private function math:try-exact-divide(759declare %private function math:try-exact-divide(
782 $numbers as xs:integer*,760 $numbers as integer*,
783 $divider as xs:integer) as xs:boolean761 $divider as integer) as boolean
784{762{
785 if (fn:empty($numbers)) then763 if (fn:empty($numbers)) then
786 fn:true()764 true
787 else765 else
788 if ($numbers[1] mod $divider ne 0) then766 if ($numbers[1] mod $divider ne 0) then
789 fn:false()767 false
790 else768 else
791 math:try-exact-divide(fn:subsequence($numbers, 2), $divider)769 math:try-exact-divide(fn:subsequence($numbers, 2), $divider)
792};770};
793771
794(:~772(:~
795 : Borrowed from excel module.<br/>773 : Function for computing GCD.<p/>
796 : Function for computing GCD.
797 : This function should not be used outside this module.
798 : This function iterates through possible divisors and checks if the sequence774 : This function iterates through possible divisors and checks if the sequence
799 : divides exactly to any of those. It starts from the minimum value from the775 : divides exactly to any of those. It starts from the minimum value from the
800 : sequence and searches downwards.776 : sequence and searches downwards.<p/>
801 :777 : Borrowed from excel module.
802 : @param $numbers The sequence of positive integers.778 : @param $numbers The sequence of positive integers.
803 : @param $min-nonzero The minimum value of numbers sequence, excluding the zero value.779 : @param $min-nonzero The minimum value of numbers sequence, excluding the zero value.
804 : @param $iteration Which iteration is it. It starts from 1 and continues780 : @param $iteration Which iteration is it. It starts from 1 and continues
@@ -806,9 +782,9 @@
806 : @return The greatest common divisor if found, or 1 if not found.782 : @return The greatest common divisor if found, or 1 if not found.
807 :)783 :)
808declare %private function math:iterate-all-gcd(784declare %private function math:iterate-all-gcd(
809 $numbers as xs:integer*, 785 $numbers as integer*,
810 $min-nonzero as xs:integer,786 $min-nonzero as integer,
811 $iteration as xs:integer) as xs:integer787 $iteration as integer) as integer
812{788{
813 if ($min-nonzero mod $iteration eq 0) then789 if ($min-nonzero mod $iteration eq 0) then
814 if (math:try-exact-divide($numbers, $min-nonzero idiv $iteration)) then790 if (math:try-exact-divide($numbers, $min-nonzero idiv $iteration)) then
@@ -816,21 +792,21 @@
816 else792 else
817 math:iterate-all-gcd($numbers, $min-nonzero, $iteration + 1)793 math:iterate-all-gcd($numbers, $min-nonzero, $iteration + 1)
818 else794 else
819 if ($iteration > $min-nonzero idiv 2) then795 if ($iteration gt $min-nonzero idiv 2) then
820 1796 1
821 else797 else
822 math:iterate-all-gcd($numbers, $min-nonzero, $iteration + 1)798 math:iterate-all-gcd($numbers, $min-nonzero, $iteration + 1)
823};799};
824800
825(:~801(:~
826 : Borrowed from excel module.<br/>802 : Returns the greatest common divisor GCD of a sequence of integers.<p/>
827 : Returns the greatest common divisor GCD of a sequence of integers.803 : The sequence can have one or more positive integers.<p/>
828 : The sequence can have one or more positive integers.804 : Borrowed from excel module.
829 : 805 :
830 : @see http://office.microsoft.com/en-us/excel/HP052091041033.aspx806 : @see http://office.microsoft.com/en-us/excel/HP052091041033.aspx
831 : @param $numbers The sequence of positive integers.807 : @param $numbers The sequence of positive integers.
832 : @return The GCD as integer.808 : @return The GCD as integer.
833 : @error math:errNum if any number is smaller than zero.809 : @error math:INVALID_ARGUMENT if any number is smaller than zero.
834 : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq810 : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq
835 : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq811 : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq
836 : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq812 : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq
@@ -840,15 +816,15 @@
840 : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq816 : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq
841 : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq817 : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq
842 :)818 :)
843declare function math:gcd($numbers as xs:integer+) as xs:integer819declare function math:gcd($numbers as integer+) as integer
844{820{
845 if (fn:count($numbers) = 1) then821 if (fn:count($numbers) eq 1) then
846 $numbers[1]822 $numbers[1]
847 else823 else
848 let $minval := math:min-without-zero($numbers)824 let $minval := math:min-without-zero($numbers)
849 return825 return
850 if ($minval lt 0) then826 if ($minval lt 0) then
851 fn:error($math:errNum, "gcd function: numbers should be greater than zero or equal")827 fn:error($math:INVALID_ARGUMENT, "gcd function: numbers should be greater than zero or equal")
852 else if ($minval eq 0) then828 else if ($minval eq 0) then
853 0829 0
854 else 830 else
@@ -856,22 +832,22 @@
856};832};
857833
858(:~834(:~
859 : Borrowed from excel module.<br/>835 : Returns the least common multiple of integers.<p/>
860 : Returns the least common multiple of integers.<br/>836 : LCM for two numbers is computed by multiplying them and dividing with GCD.
861 : LCM for two numbers is computed by multiplying them and dividing with GCD. <br/>837 : The function is applied recursively replacing the first two numbers in the sequence with their LCM.<p/>
862 : The function is applied recursively replacing the first two numbers in the sequence with their LCM.838 : Borrowed from excel module.
863 : 839 :
864 : @see http://office.microsoft.com/en-us/excel/HP052091521033.aspx840 : @see http://office.microsoft.com/en-us/excel/HP052091521033.aspx
865 : @param $numbers The sequence of one or more positive integers.841 : @param $numbers The sequence of one or more positive integers.
866 : @return The LCM as integer.842 : @return The LCM as integer.
867 : @error math:errNum if any number is smaller than zero.843 : @error math:INVALID_ARGUMENT if any number is smaller than zero.
868 : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq844 : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq
869 : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq845 : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq
870 : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq846 : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq
871 : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq847 : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq
872 : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq848 : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq
873 :)849 :)
874declare function math:lcm($numbers as xs:integer+) as xs:integer850declare function math:lcm($numbers as integer+) as integer
875{851{
876 if(count($numbers) eq 1) then852 if(count($numbers) eq 1) then
877 $numbers[1]853 $numbers[1]
@@ -889,11 +865,11 @@
889};865};
890866
891(:~867(:~
892 : Borrowed from excel module.<br/>868 : Returns a number rounded to the desired multiple.<p/>
893 : Returns a number rounded to the desired multiple.
894 : MROUND rounds up, away from zero, if the remainder of dividing number by multiple869 : MROUND rounds up, away from zero, if the remainder of dividing number by multiple
895 : is greater than or equal to half the value of multiple.870 : is greater than or equal to half the value of multiple.
896 : MROUND is computed through math:floor function.871 : MROUND is computed through math:floor function.<p/>
872 : Borrowed from excel module.
897 : 873 :
898 : @see http://office.microsoft.com/en-us/excel/HP052091851033.aspx874 : @see http://office.microsoft.com/en-us/excel/HP052091851033.aspx
899 : @param $number The value to round, 875 : @param $number The value to round,
@@ -904,8 +880,8 @@
904 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq880 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq
905 :)881 :)
906declare function math:mround(882declare function math:mround(
907 $number as xs:decimal,883 $number as decimal,
908 $multiple as xs:double) as xs:double884 $multiple as double) as double
909{885{
910 let $num := $number886 let $num := $number
911 let $mul := $multiple887 let $mul := $multiple
@@ -923,25 +899,25 @@
923};899};
924900
925(:~901(:~
926 : Borrowed from excel module.<br/>902 : Converts an Arabic numeral to roman, as text.<p/>
927 : Converts an Arabic numeral to roman, as text.903 : Only the classic format is supported (out of all formats Excel requires).
928 : Only the classic format is supported (out of all formats Excel requires).<br/>
929 : M is the largest digit, it represents 1000.904 : M is the largest digit, it represents 1000.
930 : Numbers bigger than 2000 will be represented by a sequence of "M".<br/>905 : Numbers bigger than 2000 will be represented by a sequence of "M".
931 : D = 500, C = 100, L = 50, X = 10, V = 5, I = 1.906 : D = 500, C = 100, L = 50, X = 10, V = 5, I = 1.<p/>
907 : Borrowed from excel module.
932 : 908 :
933 : @see http://office.microsoft.com/en-us/excel/HP052092381033.aspx909 : @see http://office.microsoft.com/en-us/excel/HP052092381033.aspx
934 : @param $number A positive integer.910 : @param $number A positive integer.
935 : @return The roman string representation.911 : @return The roman string representation.
936 : @error math:errNum if the input integer is negative 912 : @error math:INVALID_ARGUMENT if the input integer is negative
937 : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq913 : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq
938 : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq914 : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq
939 : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq915 : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq
940 :)916 :)
941declare function math:roman($number as xs:integer) as xs:string917declare function math:roman($number as integer) as string
942{918{
943 if ($number lt 0) then919 if ($number lt 0) then
944 fn:error($math:errNum, "Roman function: number should be greater than zero or equal")920 fn:error($math:INVALID_ARGUMENT, "Roman function: number should be greater than zero or equal")
945 else if ($number ge 1000) then921 else if ($number ge 1000) then
946 fn:concat("M", math:roman($number - 1000))922 fn:concat("M", math:roman($number - 1000))
947 else if ($number ge 900) then923 else if ($number ge 900) then
@@ -1003,9 +979,9 @@
1003};979};
1004980
1005(:~981(:~
1006 : Borrowed from excel module.<br/>
1007 : Multiplies the elements on the same position in each sequence982 : Multiplies the elements on the same position in each sequence
1008 : and sums up the results.983 : and sums up the results.<p/>
984 : Borrowed from excel module.
1009 : 985 :
1010 : @see http://office.microsoft.com/en-us/excel/HP052092931033.aspx986 : @see http://office.microsoft.com/en-us/excel/HP052092931033.aspx
1011 : @param $array1 the sequences of numbers987 : @param $array1 the sequences of numbers
@@ -1013,8 +989,8 @@
1013 : @return the sum of products989 : @return the sum of products
1014 : @example test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq990 : @example test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq
1015:)991:)
1016 declare function math:sumproduct( $array1 as xs:double*,992 declare function math:sumproduct( $array1 as double*,
1017 $array2 as xs:double* ) as xs:double993 $array2 as double* ) as double
1018 {994 {
1019 if( fn:empty($array1) or 995 if( fn:empty($array1) or
1020 fn:empty($array2)) 996 fn:empty($array2))
@@ -1026,16 +1002,16 @@
1026 };1002 };
10271003
1028(:~1004(:~
1029 : Borrowed from excel module.<br/>1005 : Returns the sum of the squares of the arguments.<p/>
1030 : Returns the sum of the squares of the arguments.1006 : It uses the sumproduct function.<p/>
1031 : It uses the sumproduct function.1007 : Borrowed from excel module.
1032 : 1008 :
1033 : @see http://office.microsoft.com/en-us/excel/HP052092951033.aspx1009 : @see http://office.microsoft.com/en-us/excel/HP052092951033.aspx
1034 : @param $numbers the sequence of one or more numbers1010 : @param $numbers the sequence of one or more numbers
1035 : @return the sum of squared values, as numeric type1011 : @return the sum of squared values, as numeric type
1036 : @example test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq1012 : @example test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq
1037:)1013:)
1038 declare function math:sumsq( $numbers as xs:double+) as xs:double1014 declare function math:sumsq( $numbers as double+) as double
1039 {1015 {
1040 math:sumproduct($numbers, $numbers)1016 math:sumproduct($numbers, $numbers)
1041 };1017 };
@@ -1045,12 +1021,11 @@
1045(:Excel statistical functions :)1021(:Excel statistical functions :)
10461022
1047(:~1023(:~
1048 : Borrowed from excel module.<br/>1024 : Returns the median of the given numbers. <p/>
1049 : Returns the median of the given numbers.
1050 : The median is the number in the middle of a set of numbers.1025 : The median is the number in the middle of a set of numbers.
1051 : Half the numbers have values that are greater than the median, 1026 : Half the numbers have values that are greater than the median,
1052 : and half the numbers have values that are less than the median. 1027 : and half the numbers have values that are less than the median. <p/>
1053 : 1028 : Borrowed from excel module.
1054 : 1029 :
1055 : @see http://office.microsoft.com/en-us/excel/HP052091741033.aspx1030 : @see http://office.microsoft.com/en-us/excel/HP052091741033.aspx
1056 : @param $numbers the sequence of numbers, of any length1031 : @param $numbers the sequence of numbers, of any length
@@ -1059,71 +1034,71 @@
1059 : @example test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq1034 : @example test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq
1060 : @example test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq1035 : @example test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq
1061:)1036:)
1062declare function math:median( $numbers as xs:double* ) as xs:double1037declare function math:median( $numbers as double* ) as double
1063{1038{
1064 let $number_count := fn:count( $numbers )1039 let $number_count := fn:count( $numbers )
1065 let $sorted_numbers := math:sort-numbers( $numbers ) return1040 let $sorted_numbers := math:sort-numbers( $numbers ) return
1066 if ($number_count mod 2 != 0) then1041 if ($number_count mod 2 ne 0) then
1067 $sorted_numbers[$number_count idiv 2 + 1]1042 $sorted_numbers[$number_count idiv 2 + 1]
1068 else1043 else
1069 if ($number_count = 0) then1044 if ($number_count eq 0) then
1070 01045 0
1071 else1046 else
1072 ($sorted_numbers[$number_count idiv 2] + $sorted_numbers[$number_count idiv 2 + 1] ) div 21047 ($sorted_numbers[$number_count idiv 2] + $sorted_numbers[$number_count idiv 2 + 1] ) div 2
1073};1048};
10741049
1075(:~1050(:~
1076 : Borrowed from excel module.<br/>1051 : Returns the most frequently occurring, or repetitive, value in a sequence.<p/>
1077 : Returns the most frequently occurring, or repetitive, value in a sequence.1052 : Borrowed from excel module.
1078 : 1053 :
1079 : @see http://office.microsoft.com/en-us/excel/HP052091831033.aspx1054 : @see http://office.microsoft.com/en-us/excel/HP052091831033.aspx
1080 : @param $numbers the sequence of numbers, of any length1055 : @param $numbers the sequence of numbers, of any length
1081 : @return The most occuring number1056 : @return The most occuring number
1082 : @error math:errNA if there are no duplicate numbers1057 : @error math:INVALID_INPUT if there are no duplicate numbers
1083 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq1058 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq
1084 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq1059 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq
1085 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq1060 : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq
1086:)1061:)
1087declare function math:mode( $numbers as xs:double* ) as xs:double1062declare function math:mode( $numbers as double* ) as double
1088{1063{
1089 if ( fn:empty($numbers)) then1064 if ( fn:empty($numbers)) then
1090 fn:error($math:errNA, "Mode function: empty sequence")1065 fn:error($math:INVALID_INPUT, "Mode function: empty sequence")
1091 else1066 else
1092 let $result := 1067 let $result :=
1093 ( for $n_at in fn:distinct-values($numbers) 1068 ( for $n_at in fn:distinct-values($numbers)
1094 let $n := $n_at1069 let $n := $n_at
1095 let $count := fn:count( (for $d in $numbers where $d eq $n return $d) )1070 let $count := fn:count( (for $d in $numbers where $d eq $n return $d) )
1096 where $count > 1 1071 where $count gt 1
1097 order by $count descending1072 order by $count descending
1098 return $n1073 return $n
1099 ) return 1074 ) return
1100 if (fn:empty($result)) then1075 if (fn:empty($result)) then
1101 fn:error($math:errNA, "Mode function: no duplicate elements")1076 fn:error($math:INVALID_INPUT, "Mode function: no duplicate elements")
1102 else1077 else
1103 $result[1]1078 $result[1]
1104};1079};
11051080
1106(:~1081(:~
1107 : Borrowed from excel module.<br/>1082 : Returns the k-th percentile of values in a sequence.<p/>
1108 : Returns the k-th percentile of values in a sequence.
1109 : If k is not a multiple of 1/(n - 1), 1083 : If k is not a multiple of 1/(n - 1),
1110 : PERCENTILE interpolates to determine the value at the k-th percentile. 1084 : PERCENTILE interpolates to determine the value at the k-th percentile.
1111 : The function is computed by (max-min)*k + min1085 : The function is computed by (max-min)*k + min<p/>
1086 : Borrowed from excel module.
1112 : 1087 :
1113 : @see http://office.microsoft.com/en-us/excel/HP052092111033.aspx1088 : @see http://office.microsoft.com/en-us/excel/HP052092111033.aspx
1114 : @param $numbers the sequence of numbers, of any length1089 : @param $numbers the sequence of numbers, of any length
1115 : @param $k_at the percentile, with value between 0 .. 1 inclusive1090 : @param $k_at the percentile, with value between 0 .. 1 inclusive
1116 : @return The computed percentile1091 : @return The computed percentile
1117 : @error math:errNum if percentile is not between 0 .. 11092 : @error math:INVALID_ARGUMENT if percentile is not between 0 .. 1
1118 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq1093 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq
1119 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq1094 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq
1120 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq1095 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq
1121:)1096:)
1122declare function math:percentile( $numbers as xs:double*, $k_at as xs:double) as xs:double1097declare function math:percentile( $numbers as double*, $k_at as double) as double
1123{1098{
1124 let $k := $k_at return1099 let $k := $k_at return
1125 if ($k < 0 or $k > 1) then1100 if ($k lt 0 or $k gt 1) then
1126 fn:error($math:errNum, "Percentile function: k must be a value between 0 and 1 inclusive")1101 fn:error($math:INVALID_ARGUMENT, "Percentile function: k must be a value between 0 and 1 inclusive")
1127 else1102 else
1128 let $max := fn:max($numbers)1103 let $max := fn:max($numbers)
1129 let $min := fn:min($numbers) return1104 let $min := fn:min($numbers) return
@@ -1133,10 +1108,9 @@
11331108
11341109
1135(:~1110(:~
1136 : Borrowed from excel module.<br/>1111 : Function for AVEDEV.<p/>
1137 : Function for AVEDEV.1112 : Computes formula sum(abs(x - average)) for every x in $numbers<p/>
1138 : This function should not be used outside this module.1113 : Borrowed from excel module.
1139 : Computes formula sum(abs(x - average)) for every x in $numbers
1140 :1114 :
1141 : @param $numbers The sequence of numbers.1115 : @param $numbers The sequence of numbers.
1142 : Sequence can be of any length.1116 : Sequence can be of any length.
@@ -1144,8 +1118,8 @@
1144 : @return The result of the formula.1118 : @return The result of the formula.
1145 :)1119 :)
1146declare %private function math:sum-deviations(1120declare %private function math:sum-deviations(
1147 $numbers as xs:double*,1121 $numbers as double*,
1148 $average as xs:double) as xs:double1122 $average as double) as double
1149{1123{
1150 if (fn:empty($numbers)) then1124 if (fn:empty($numbers)) then
1151 01125 0
@@ -1154,9 +1128,9 @@
1154};1128};
11551129
1156(:~1130(:~
1157 : Borrowed from excel module.<br/>1131 : Returns the average of the absolute deviations of data points from their mean.<p/>
1158 : Returns the average of the absolute deviations of data points from their mean.1132 : The formula is sum(abs(x - average_x))/n, where n is the count of x in the sequence.<p/>
1159 : The formula is sum(abs(x - average_x))/n, where n is the count of x in the sequence.1133 : Borrowed from excel module.
1160 : 1134 :
1161 : @see http://office.microsoft.com/en-us/excel/HP052089931033.aspx1135 : @see http://office.microsoft.com/en-us/excel/HP052089931033.aspx
1162 : @param $numbers the sequence of numbers.1136 : @param $numbers the sequence of numbers.
@@ -1164,36 +1138,36 @@
1164 : @return The formula result1138 : @return The formula result
1165 : @example test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq1139 : @example test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq
1166:)1140:)
1167declare function math:avedev($numbers as xs:double+) as xs:double1141declare function math:avedev($numbers as double+) as double
1168{1142{
1169 let $average := fn:avg($numbers) return1143 let $average := fn:avg($numbers) return
1170 math:sum-deviations($numbers, $average) div fn:count($numbers)1144 math:sum-deviations($numbers, $average) div fn:count($numbers)
1171};1145};
11721146
1173(:~1147(:~
1174 : Borrowed from excel module.<br/>1148 : Returns the k-th largest value in a data set. <p/>
1175 : Returns the k-th largest value in a data set.
1176 : If n is the number of data points in a range, 1149 : If n is the number of data points in a range,
1177 : then LARGE(array,1) returns the largest value, 1150 : then LARGE(array,1) returns the largest value,
1178 : and LARGE(array,n) returns the smallest value.1151 : and LARGE(array,n) returns the smallest value.<p/>
1152 : Borrowed from excel module.<br/>
1179 : 1153 :
1180 : @see http://office.microsoft.com/en-us/excel/HP052091511033.aspx1154 : @see http://office.microsoft.com/en-us/excel/HP052091511033.aspx
1181 : @param $numbers the sequence of numbers1155 : @param $numbers the sequence of numbers
1182 : The sequence can be of any length, from 1 up.1156 : The sequence can be of any length, from 1 up.
1183 : @param $k the position of largest value, with value from 1 to count of values1157 : @param $k the position of largest value, with value from 1 to count of values
1184 : @return The k-th largest value as numeric type1158 : @return The k-th largest value as numeric type
1185 : @error math:errNum if the sequence is empty or k is not a value between 11159 : @error math:INVALID_ARGUMENT if the sequence is empty or k is not a value between 1
1186 : and the size of the sequence1160 : and the size of the sequence
1187 : @example test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq1161 : @example test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq
1188 : @example test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq1162 : @example test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq
1189 : @example test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq1163 : @example test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq
1190:)1164:)
1191declare function math:large($numbers as xs:double+, $k as xs:integer) as xs:double1165declare function math:large($numbers as double+, $k as integer) as double
1192{1166{
1193 if (fn:empty($numbers)) then1167 if (fn:empty($numbers)) then
1194 fn:error($math:errNum, "Large function: value list must not be empty") 1168 fn:error($math:INVALID_ARGUMENT, "Large function: value list must not be empty")
1195 else if ($k > fn:count($numbers) or $k le 0) then1169 else if ($k gt fn:count($numbers) or $k le 0) then
1196 fn:error($math:errNum, "Large function: k must be between 1 and the count of numbers ", $k)1170 fn:error($math:INVALID_ARGUMENT, "Large function: k must be between 1 and the count of numbers ", $k)
1197 else1171 else
1198 let $ordered_numbers :=1172 let $ordered_numbers :=
1199 (for $n in $numbers 1173 (for $n in $numbers
@@ -1205,11 +1179,11 @@
1205};1179};
12061180
1207(:~1181(:~
1208 : Borrowed from excel module.<br/>1182 : Returns the rank of a number in a list of numbers. <p/>
1209 : Returns the rank of a number in a list of numbers.
1210 : The rank of a number is its size relative to other values in a list. 1183 : The rank of a number is its size relative to other values in a list.
1211 : (If you were to sort the list, the rank of the number would be its position.)1184 : (If you were to sort the list, the rank of the number would be its position.)
1212 : RANK gives duplicate numbers the same rank.1185 : RANK gives duplicate numbers the same rank.<p/>
1186 : Borrowed from excel module.
1213 : 1187 :
1214 : @see http://office.microsoft.com/en-us/excel/HP052092311033.aspx1188 : @see http://office.microsoft.com/en-us/excel/HP052092311033.aspx
1215 : @param $x The number whose rank you want to find.1189 : @param $x The number whose rank you want to find.
@@ -1224,9 +1198,9 @@
1224 : @example test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq1198 : @example test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq
1225 :)1199 :)
1226declare function math:rank(1200declare function math:rank(
1227 $x as xs:double, 1201 $x as double,
1228 $numbers as xs:double*, 1202 $numbers as double*,
1229 $order_ascending as xs:boolean) as xs:double1203 $order_ascending as boolean) as double
1230{1204{
1231 let $ordered_numbers :=1205 let $ordered_numbers :=
1232 if ($order_ascending) then (1206 if ($order_ascending) then (
@@ -1244,12 +1218,12 @@
1244 let $rank :=1218 let $rank :=
1245 (1219 (
1246 for $i at $pos in $ordered_numbers1220 for $i at $pos in $ordered_numbers
1247 where $xnum = $i or $order_ascending and $xnum < $i1221 where $xnum eq $i or $order_ascending and $xnum lt $i
1248 or fn:not($order_ascending) and $xnum > $i1222 or fn:not($order_ascending) and $xnum gt $i
1249 return 1223 return
1250 if ($xnum = $i) then1224 if ($xnum eq $i) then
1251 $pos1225 $pos
1252 else if ($pos = 1) then1226 else if ($pos eq 1) then
1253 01227 0
1254 else1228 else
1255 ($pos - 1) + ($xnum - $ordered_numbers[$pos - 1]) div ($ordered_numbers[$pos] - $ordered_numbers[$pos - 1])1229 ($pos - 1) + ($xnum - $ordered_numbers[$pos - 1]) div ($ordered_numbers[$pos] - $ordered_numbers[$pos - 1])
@@ -1262,8 +1236,8 @@
1262};1236};
12631237
1264(:~1238(:~
1265 : Borrowed from excel module.<br/>1239 : This RANK function is same as the above, only that $order_ascending is set by default to false.<p/>
1266 : This RANK function is same as the above, only that $order_ascending is set by default to false.1240 : Borrowed from excel module.
1267 : 1241 :
1268 : @see http://office.microsoft.com/en-us/excel/HP052092311033.aspx1242 : @see http://office.microsoft.com/en-us/excel/HP052092311033.aspx
1269 : @param $x The number whose rank you want to find.1243 : @param $x The number whose rank you want to find.
@@ -1274,46 +1248,45 @@
1274 : @example test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq1248 : @example test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq
1275:)1249:)
1276declare function math:rank(1250declare function math:rank(
1277 $x as xs:double, 1251 $x as double,
1278 $numbers as xs:double*) as xs:double1252 $numbers as double*) as double
1279{1253{
1280 math:rank($x, $numbers, fn:false())1254 math:rank($x, $numbers, false)
1281};1255};
12821256
1283(:~1257(:~
1284 : Borrowed from excel module.<br/>1258 : Returns the rank of a value in a data set as a percentage of the data set.<p/>
1285 : Returns the rank of a value in a data set as a percentage of the data set.
1286 : If x does not match one of the values in array, 1259 : If x does not match one of the values in array,
1287 : PERCENTRANK interpolates to return the correct percentage rank. <br/>1260 : PERCENTRANK interpolates to return the correct percentage rank. <br/>
1288 : The formula is uses: (RANK - 1) / (size - 1) .1261 : The formula is uses: (RANK - 1) / (size - 1) .<p/>
1289 : 1262 : Borrowed from excel module.
1290 : @see http://office.microsoft.com/en-us/excel/HP052092121033.aspx1263 : @see http://office.microsoft.com/en-us/excel/HP052092121033.aspx
1291 : @param $numbers the sequence of numbers.1264 : @param $numbers the sequence of numbers.
1292 : The sequence can be of any length, from 1 up.1265 : The sequence can be of any length, from 1 up.
1293 : @param $x is the value for which you want to know the rank1266 : @param $x is the value for which you want to know the rank
1294 : @return The percentage of rank. 1267 : @return The percentage of rank.
1295 : @error math:errNum if the sequence is zero length1268 : @error math:INVALID_ARGUMENT if the sequence is zero length
1296 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq1269 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq
1297 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq1270 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq
1298 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq1271 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq
1299 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq1272 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq
1300 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq1273 : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq
1301:)1274:)
1302declare function math:percentrank($numbers as xs:double*, $x as xs:double) as xs:double1275declare function math:percentrank($numbers as double*, $x as double) as double
1303{1276{
1304 if (fn:empty($numbers)) then1277 if (fn:empty($numbers)) then
1305 fn:error($math:errNum, "Percentrank function: value list must not be empty")1278 fn:error($math:INVALID_ARGUMENT, "Percentrank function: value list must not be empty")
1306 else 1279 else
1307 let $rank := math:rank($x, $numbers, fn:true()) return1280 let $rank := math:rank($x, $numbers, true) return
1308 if ($rank = 0) then1281 if ($rank eq 0) then
1309 01282 0
1310 else1283 else
1311 ($rank - 1) div (fn:count($numbers) - 1)1284 ($rank - 1) div (fn:count($numbers) - 1)
1312};1285};
13131286
1314(:~1287(:~
1315 : Borrowed from excel module.<br/>1288 : Returns the quartile of a data set. <p/>
1316 : Returns the quartile of a data set. 1289 : Borrowed from excel module.
1317 : 1290 :
1318 : @see http://office.microsoft.com/en-us/excel/HP052092261033.aspx1291 : @see http://office.microsoft.com/en-us/excel/HP052092261033.aspx
1319 : @param $numbers sequence of numbers.1292 : @param $numbers sequence of numbers.
@@ -1325,50 +1298,50 @@
1325 : <dt>3</dt> <dd> compute third quartile (75th percentile)</dd>1298 : <dt>3</dt> <dd> compute third quartile (75th percentile)</dd>
1326 : <dt>4</dt> <dd> compute maximum value</dd></dl>1299 : <dt>4</dt> <dd> compute maximum value</dd></dl>
1327 : @return the computed quartile, as numeric type1300 : @return the computed quartile, as numeric type
1328 : @error math:errNum if the sequence is zero length or $quart is not one of the values 0,1,3,41301 : @error math:INVALID_ARGUMENT if the sequence is zero length or $quart is not one of the values 0,1,3,4
1329 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq1302 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq
1330 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq1303 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq
1331 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq1304 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq
1332 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq1305 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq
1333 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq1306 : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq
1334:)1307:)
1335declare function math:quartile($numbers as xs:double*, $quart as xs:integer) as xs:double1308declare function math:quartile($numbers as double*, $quart as integer) as double
1336{1309{
1337 if (fn:empty($numbers)) then1310 if (fn:empty($numbers)) then
1338 fn:error($math:errNum, "Quartile function: value list must not be empty")1311 fn:error($math:INVALID_ARGUMENT, "Quartile function: value list must not be empty")
1339 else 1312 else
1340 if ($quart = 0) then1313 if ($quart eq 0) then
1341 fn:min($numbers)1314 fn:min($numbers)
1342 else1315 else
1343 if ($quart = 1) then1316 if ($quart eq 1) then
1344 let $r := (fn:count($numbers) + 3) div 41317 let $r := (fn:count($numbers) + 3) div 4
1345 let $rint := xs:integer($r)1318 let $rint := integer($r)
1346 let $rrem := $r - $rint 1319 let $rrem := $r - $rint
1347 let $sorted_numbers := math:sort-numbers( $numbers ) return1320 let $sorted_numbers := math:sort-numbers( $numbers ) return
1348 ($numbers[$rint + 1] - $numbers[$rint]) * $rrem + $numbers[$rint] 1321 ($numbers[$rint + 1] - $numbers[$rint]) * $rrem + $numbers[$rint]
1349 else1322 else
1350 if ($quart = 2) then1323 if ($quart eq 2) then
1351 math:median($numbers)1324 math:median($numbers)
1352 else1325 else
1353 if ($quart = 3) then1326 if ($quart eq 3) then
1354 let $r := (3 * fn:count($numbers) + 1) div 41327 let $r := (3 * fn:count($numbers) + 1) div 4
1355 let $rint := xs:integer($r)1328 let $rint := integer($r)
1356 let $rrem := $r - $rint 1329 let $rrem := $r - $rint
1357 let $sorted_numbers := math:sort-numbers( $numbers ) return1330 let $sorted_numbers := math:sort-numbers( $numbers ) return
1358 ($numbers[$rint + 1] - $numbers[$rint]) * $rrem + $numbers[$rint] 1331 ($numbers[$rint + 1] - $numbers[$rint]) * $rrem + $numbers[$rint]
1359 else1332 else
1360 if ($quart = 4) then1333 if ($quart eq 4) then
1361 fn:max($numbers)1334 fn:max($numbers)
1362 else1335 else
1363 fn:error($math:errNum, "Quartile function: quart should be between 0 and 4 :", $quart)1336 fn:error($math:INVALID_ARGUMENT, "Quartile function: quart should be between 0 and 4 :", $quart)
1364};1337};
13651338
1366(:~1339(:~
1367 : Borrowed from excel module.<br/>1340 : This function computes the k-th smallest value in a data set. <p/>
1368 : This function computes the k-th smallest value in a data set.
1369 : Use this function to return values with a particular relative standing in a data set.1341 : Use this function to return values with a particular relative standing in a data set.
1370 : If n is the number of data points in array, SMALL(array,1) equals the smallest value, 1342 : If n is the number of data points in array, SMALL(array,1) equals the smallest value,
1371 : and SMALL(array,n) equals the largest value. 1343 : and SMALL(array,n) equals the largest value.
1344 : Borrowed from excel module.
1372 : 1345 :
1373 : @see http://office.microsoft.com/en-us/excel/HP052092661033.aspx1346 : @see http://office.microsoft.com/en-us/excel/HP052092661033.aspx
1374 : @param $numbers A sequence of numbers.1347 : @param $numbers A sequence of numbers.
@@ -1376,17 +1349,17 @@
1376 : @param $k The position (from the smallest) in the sequence of data to return.1349 : @param $k The position (from the smallest) in the sequence of data to return.
1377 : Must have value between 1 and size of sequence.1350 : Must have value between 1 and size of sequence.
1378 : @return The k-th smallest value of $numbers.1351 : @return The k-th smallest value of $numbers.
1379 : @error math:errNum if the sequence is zero length or $k is not a value1352 : @error math:INVALID_ARGUMENT if the sequence is zero length or $k is not a value
1380 : between 1 and the size of sequence.1353 : between 1 and the size of sequence.
1381 : @example test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq1354 : @example test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq
1382 : @example test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq1355 : @example test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq
1383:)1356:)
1384declare function math:small($numbers as xs:double*, $k as xs:integer) as xs:double1357declare function math:small($numbers as double*, $k as integer) as double
1385{1358{
1386 if (fn:empty($numbers)) then1359 if (fn:empty($numbers)) then
1387 fn:error($math:errNum, "Small function: value list must not be empty")1360 fn:error($math:INVALID_ARGUMENT, "Small function: value list must not be empty")
1388 else if ($k gt fn:count($numbers) or $k le 0) then1361 else if ($k gt fn:count($numbers) or $k le 0) then
1389 fn:error($math:errNum, "Small function: k must be between 1 and the count of numbers ", $k)1362 fn:error($math:INVALID_ARGUMENT, "Small function: k must be between 1 and the count of numbers ", $k)
1390 else1363 else
1391 let $ordered_numbers := (1364 let $ordered_numbers := (
1392 for $n in $numbers 1365 for $n in $numbers
@@ -1400,17 +1373,16 @@
14001373
14011374
1402(:~1375(:~
1403 : Borrowed from excel module.<br/>1376 : Function for VAR, VARA, VARP, VARPA and SLOPE.<p/>
1404 : Function for VAR, VARA, VARP, VARPA and SLOPE.1377 : It computes formula sum((x - average_x)^2) for all x in $numbers.<p/>
1405 : This function should not be used outside this module.1378 : Borrowed from excel module.
1406 : It computes formula sum((x - average_x)^2) for all x in $numbers.
1407 :1379 :
1408 : @param $numbers the sequence of numbers.1380 : @param $numbers the sequence of numbers.
1409 : The sequence can be of any length.1381 : The sequence can be of any length.
1410 : @param $average The precomputed average over the sequence.1382 : @param $average The precomputed average over the sequence.
1411 : @return The result as numeric type.1383 : @return The result as numeric type.
1412 :)1384 :)
1413declare %private function math:sumsq-deviations($numbers as xs:double*, $average as xs:double) as xs:double1385declare %private function math:sumsq-deviations($numbers as double*, $average as double) as double
1414{1386{
1415 if (fn:empty($numbers)) then1387 if (fn:empty($numbers)) then
1416 01388 0
@@ -1421,11 +1393,11 @@
1421};1393};
14221394
1423(:~1395(:~
1424 : Borrowed from excel module.<br/>1396 : Estimates variance based on a sample.<p/>
1425 : Estimates variance based on a sample.<br/>1397 : The formula is sum(x - average_x)^2 / (n - 1).
1426 : The formula is sum(x - average_x)^2 / (n - 1).<br/>1398 : average_x is computed with AVERAGE function.
1427 : average_x is computed with AVERAGE function.<br/>1399 : n is the count of numbers from the sequence, excluding empty values.<p/>
1428 : n is the count of numbers from the sequence, excluding empty values.1400 : Borrowed from excel module.
1429 : 1401 :
1430 : @see http://office.microsoft.com/en-us/excel/HP052093301033.aspx1402 : @see http://office.microsoft.com/en-us/excel/HP052093301033.aspx
1431 : @param $numbers the sequence of numbers.1403 : @param $numbers the sequence of numbers.
@@ -1433,7 +1405,7 @@
1433 : @return The variance, as numeric type1405 : @return The variance, as numeric type
1434 : @example test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq1406 : @example test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq
1435 :)1407 :)
1436declare function math:var($numbers as xs:double+) as xs:double1408declare function math:var($numbers as double+) as double
1437{1409{
1438 let $average := fn:avg($numbers)1410 let $average := fn:avg($numbers)
1439 return1411 return
@@ -1441,11 +1413,11 @@
1441};1413};
14421414
1443(:~1415(:~
1444 : Borrowed from excel module.<br/>1416 : Estimates variance based on a sample.<p/>
1445 : Estimates variance based on a sample.<br/>1417 : The formula is sum(x - average_x)^2 / (n - 1).
1446 : The formula is sum(x - average_x)^2 / (n - 1).<br/>1418 : average_x is computed with AVERAGE function.
1447 : average_x is computed with AVERAGE function.<br/>1419 : n is the size of sequence, including empty values.<p/>
1448 : n is the size of sequence, including empty values.<br/>1420 : Borrowed from excel module.
1449 : 1421 :
1450 : @see http://office.microsoft.com/en-us/excel/HP052093311033.aspx1422 : @see http://office.microsoft.com/en-us/excel/HP052093311033.aspx
1451 : @param $numbers the sequence of numbers.1423 : @param $numbers the sequence of numbers.
@@ -1453,18 +1425,18 @@
1453 : @return The variance, as numeric type1425 : @return The variance, as numeric type
1454 : @example test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq1426 : @example test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq
1455:)1427:)
1456declare function math:vara($numbers as xs:double+) as xs:double1428declare function math:vara($numbers as double+) as double
1457{1429{
1458 let $average := fn:avg($numbers) return1430 let $average := fn:avg($numbers) return
1459 math:sumsq-deviations($numbers, $average) div (fn:count($numbers) - 1)1431 math:sumsq-deviations($numbers, $average) div (fn:count($numbers) - 1)
1460};1432};
14611433
1462(:~1434(:~
1435 : Calculates variance based on the entire population.<p/>
1436 : The formula is sum(x - average_x)^2 / n.
1437 : average_x is computed with AVERAGE function.
1438 : n is the count of numbers from the sequence, excluding empty values.<p/>
1463 : Borrowed from excel module.<br/>1439 : Borrowed from excel module.<br/>
1464 : Calculates variance based on the entire population.<br/>
1465 : The formula is sum(x - average_x)^2 / n.<br/>
1466 : average_x is computed with AVERAGE function.<br/>
1467 : n is the count of numbers from the sequence, excluding empty values.<br/>
1468 : 1440 :
1469 : @see http://office.microsoft.com/en-us/excel/HP052093321033.aspx1441 : @see http://office.microsoft.com/en-us/excel/HP052093321033.aspx
1470 : @param $numbers the sequence of numbers.1442 : @param $numbers the sequence of numbers.
@@ -1472,18 +1444,18 @@
1472 : @return The variance, as numeric type1444 : @return The variance, as numeric type
1473 : @example test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq1445 : @example test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq
1474:)1446:)
1475declare function math:varp($numbers as xs:double+) as xs:double1447declare function math:varp($numbers as double+) as double
1476{1448{
1477 let $average := fn:avg($numbers) return1449 let $average := fn:avg($numbers) return
1478 math:sumsq-deviations($numbers, $average) div fn:count($numbers)1450 math:sumsq-deviations($numbers, $average) div fn:count($numbers)
1479};1451};
14801452
1481(:~1453(:~
1482 : Borrowed from excel module.<br/>1454 : Calculates variance based on the entire population.<p/>
1483 : Calculates variance based on the entire population.<br/>1455 : The formula is sum(x - average_x)^2 / n.
1484 : The formula is sum(x - average_x)^2 / n.<br/>1456 : average_x is computed with AVERAGE function.
1485 : average_x is computed with AVERAGE function.<br/>1457 : n is the size of sequence, including empty values.<p/>
1486 : n is the size of sequence, including empty values.<br/>1458 : Borrowed from excel module.
1487 : 1459 :
1488 : @see http://office.microsoft.com/en-us/excel/HP052093321033.aspx1460 : @see http://office.microsoft.com/en-us/excel/HP052093321033.aspx
1489 : @param $numbers the sequence of numbers.1461 : @param $numbers the sequence of numbers.
@@ -1491,61 +1463,58 @@
1491 : @return The variance, as numeric type1463 : @return The variance, as numeric type
1492 : @example test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq1464 : @example test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq
1493:)1465:)
1494declare function math:varpa($numbers as xs:double+) as xs:double1466declare function math:varpa($numbers as double+) as double
1495{1467{
1496 let $average := fn:avg($numbers) return1468 let $average := fn:avg($numbers) return
1497 math:sumsq-deviations($numbers, $average) div fn:count($numbers)1469 math:sumsq-deviations($numbers, $average) div fn:count($numbers)
1498};1470};
14991471
1500(:~1472(:~
1501 : Borrowed from excel module.<br/>1473 : Function for PROB function.<p/>
1502 : Function for PROB function.
1503 : This function should not be used outside this module.
1504 : Computes the sum over a sequence of numbers.1474 : Computes the sum over a sequence of numbers.
1505 : Checks if the values are between 0 and 1.1475 : Checks if the values are between 0 and 1.<p/>
1476 : Borrowed from excel module.
1506 :1477 :
1507 : @param $prob_range The sequence of probabilities.1478 : @param $prob_range The sequence of probabilities.
1508 : @return The sum of probabilities. This should be 1.1479 : @return The sum of probabilities. This should be 1.
1509 : @error math:errNum if any probability is not between 0 and 1.1480 : @error math:INVALID_ARGUMENT if any probability is not between 0 and 1.
1510 : @error math:errValue if any parameter is not castable to numeric.
1511:)1481:)
1512declare %private function math:sum-prob($prob_range as xs:double*) as xs:double1482declare %private function math:sum-prob($prob_range as double*) as double
1513{1483{
1514 if (fn:empty($prob_range)) then1484 if (fn:empty($prob_range)) then
1515 01485 0
1516 else1486 else
1517 let $prob_num := $prob_range[1]1487 let $prob_num := $prob_range[1]
1518 return1488 return
1519 if ($prob_num < 0 or $prob_num > 1) then1489 if ($prob_num lt 0 or $prob_num gt 1) then
1520 fn:error($math:errNum, "Prob function: prob values should be between 0 and 1 ", $prob_num)1490 fn:error($math:INVALID_ARGUMENT, "Prob function: prob values should be between 0 and 1 ", $prob_num)
1521 else1491 else
1522 $prob_num + math:sum-prob(fn:subsequence($prob_range, 2))1492 $prob_num + math:sum-prob(fn:subsequence($prob_range, 2))
1523};1493};
15241494
1525(:~1495(:~
1526 : Borrowed from excel module.<br/>1496 : Function for PROB function.<p/>
1527 : Function for PROB function.
1528 : This function should not be used outside this module.
1529 : Checks the prob range and x range if they have the same number of values.1497 : Checks the prob range and x range if they have the same number of values.
1530 : Adds all probabilities corresponding to values between range_lower_limit and upper_limit.1498 : Adds all probabilities corresponding to values between range_lower_limit and upper_limit.<p/>
1499 : Borrowed from excel module.
1531 :1500 :
1532 : @param $x_range The sequence of x values.1501 : @param $x_range The sequence of x values.
1533 : @param $prob_range The sequence of probabilities associated to x values.1502 : @param $prob_range The sequence of probabilities associated to x values.
1534 : @param $range_lower_limit The lower limit of the range to compute the probability.1503 : @param $range_lower_limit The lower limit of the range to compute the probability.
1535 : @param $upper_limit The upper limit of the range to compute the probability.1504 : @param $upper_limit The upper limit of the range to compute the probability.
1536 : @return The sum of probabilities.1505 : @return The sum of probabilities.
1537 : @error $math:errNum if x_range and prob_range do not have the same number of values.1506 : @error $math:INVALID_ARGUMENT if x_range and prob_range do not have the same number of values.
1538 :)1507 :)
1539declare %private function math:sum-prob-x(1508declare %private function math:sum-prob-x(
1540 $x_range as xs:double*,1509 $x_range as double*,
1541 $prob_range as xs:double*,1510 $prob_range as double*,
1542 $range_lower_limit as xs:double,1511 $range_lower_limit as double,
1543 $upper_limit as xs:double) as xs:double1512 $upper_limit as double) as double
1544{1513{
1545 if (fn:empty($x_range) and fn:not(fn:empty($prob_range))) then1514 if (fn:empty($x_range) and fn:not(fn:empty($prob_range))) then
1546 fn:error($math:errNum, "Prob function: x range and prob range should have the same number of elements")1515 fn:error($math:INVALID_ARGUMENT, "Prob function: x range and prob range should have the same number of elements")
1547 else if (fn:empty($prob_range) and fn:not(fn:empty($x_range))) then1516 else if (fn:empty($prob_range) and fn:not(fn:empty($x_range))) then
1548 fn:error($math:errNum, "Prob function: x range and prob range should have the same number of elements")1517 fn:error($math:INVALID_ARGUMENT, "Prob function: x range and prob range should have the same number of elements")
1549 else if (fn:empty($prob_range) and fn:empty($x_range)) then1518 else if (fn:empty($prob_range) and fn:empty($x_range)) then
1550 01519 0
1551 else1520 else
@@ -1564,9 +1533,9 @@
1564};1533};
15651534
1566(:~1535(:~
1567 : Borrowed from excel module.<br/>1536 : Returns the probability that values in a range are between two limits.<p/>
1568 : Returns the probability that values in a range are between two limits.1537 : Borrowed from excel module.
1569 : 1538 :
1570 : @see http://office.microsoft.com/en-us/excel/HP052092221033.aspx1539 : @see http://office.microsoft.com/en-us/excel/HP052092221033.aspx
1571 : @param $x_range is the range of numeric values of x with which there are associated probabilities.1540 : @param $x_range is the range of numeric values of x with which there are associated probabilities.
1572 : This does not need to be ordered.1541 : This does not need to be ordered.
@@ -1574,19 +1543,19 @@
1574 : @param $range_lower_limit is the lower bound on the value for which you want a probability.1543 : @param $range_lower_limit is the lower bound on the value for which you want a probability.
1575 : @param $upper_limit is the upper bound on the value for which you want a probability.1544 : @param $upper_limit is the upper bound on the value for which you want a probability.
1576 : @return The probability of the entire range1545 : @return The probability of the entire range
1577 : @error math:errNum if any probability is not between 0 and 11546 : @error math:INVALID_ARGUMENT if any probability is not between 0 and 1
1578 : @error math:errNum if the sum of probabilities is not equal to 11547 : @error math:INVALID_ARGUMENT if the sum of probabilities is not equal to 1
1579 : @error math:errNum if x_range and prob_range do not have the same number of values1548 : @error math:INVALID_ARGUMENT if x_range and prob_range do not have the same number of values
1580 : @example test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq1549 : @example test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq
1581:)1550:)
1582declare function math:prob($x_range as xs:double+,1551declare function math:prob($x_range as double+,
1583 $prob_range as xs:double+,1552 $prob_range as double+,
1584 $range_lower_limit as xs:double,1553 $range_lower_limit as double,
1585 $upper_limit as xs:double) as xs:double1554 $upper_limit as double) as double
1586{1555{
1587 let $prob_sum := math:sum-prob($prob_range) return1556 let $prob_sum := math:sum-prob($prob_range) return
1588 if ($prob_sum != 1) then1557 if ($prob_sum ne 1) then
1589 fn:error($math:errNum, "Prob function: prob sum should equal 1")1558 fn:error($math:INVALID_ARGUMENT, "Prob function: prob sum should equal 1")
1590 else1559 else
1591 math:sum-prob-x($x_range, $prob_range, 1560 math:sum-prob-x($x_range, $prob_range,
1592 $range_lower_limit, 1561 $range_lower_limit,
@@ -1594,9 +1563,9 @@
1594};1563};
15951564
1596(:~1565(:~
1597 : Borrowed from excel module.<br/>1566 : This is the same as math:prob#4, only that upper_limit is not specified.<p/>
1598 : This is the same as above, only that upper_limit is not specified.1567 : The probability is computed only for range_lower_limit.<p/>
1599 : The probability is computed only for range_lower_limit.1568 : Borrowed from excel module.
1600 : 1569 :
1601 : @see http://office.microsoft.com/en-us/excel/HP052092221033.aspx1570 : @see http://office.microsoft.com/en-us/excel/HP052092221033.aspx
1602 : @param $x_range is the range of numeric values of x with which there are associated probabilities.1571 : @param $x_range is the range of numeric values of x with which there are associated probabilities.
@@ -1604,43 +1573,42 @@
1604 : @param $prob_range is a set of probabilities associated with values in x_range.1573 : @param $prob_range is a set of probabilities associated with values in x_range.
1605 : @param $range_lower_limit is the value for which you want a probability.1574 : @param $range_lower_limit is the value for which you want a probability.
1606 : @return The probability of the range_lower_limit value1575 : @return The probability of the range_lower_limit value
1607 : @error math:errNum if any probability is not between 0 and 11576 : @error math:INVALID_ARGUMENT if any probability is not between 0 and 1
1608 : @error math:errNum if the sum of probabilities is not equal to 11577 : @error math:INVALID_ARGUMENT if the sum of probabilities is not equal to 1
1609 : @error math:errNum if x_range and prob_range do not have the same number of values1578 : @error math:INVALID_ARGUMENT if x_range and prob_range do not have the same number of values
1610 : @example test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq1579 : @example test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq
1611 :)1580 :)
1612declare function math:prob($x_range as xs:double+,1581declare function math:prob($x_range as double+,
1613 $prob_range as xs:double+,1582 $prob_range as double+,
1614 $range_lower_limit as xs:double) as xs:double1583 $range_lower_limit as double) as double
1615{1584{
1616 math:prob($x_range, $prob_range, $range_lower_limit, $range_lower_limit)1585 math:prob($x_range, $prob_range, $range_lower_limit, $range_lower_limit)
1617};1586};
16181587
1619(:~1588(:~
1620 : Borrowed from excel module.<br/>1589 : Function for SLOPE function.<p/>
1621 : Function for SLOPE function.1590 : It computes the formula:<p/>
1622 : This function should not be used outside this module.1591 : sum((x - average_x)(y - average_y))<p/>
1623 : It computes the formula:<br/>1592 : where average_x and average_y are computed with AVERAGE function.<p/>
1624 : sum((x - average_x)(y - average_y)) <br/>1593 : Borrowed from excel module.
1625 : where average_x and average_y are computed with AVERAGE function.
1626 :1594 :
1627 : @param $x_numbers The sequence of x numbers.1595 : @param $x_numbers The sequence of x numbers.
1628 : @param $x_average The precomputed AVERAGE over the x_numbers.1596 : @param $x_average The precomputed AVERAGE over the x_numbers.
1629 : @param $y_numbers The sequence of y numbers.1597 : @param $y_numbers The sequence of y numbers.
1630 : @param $y_average The precomputed AVERAGE over the y_numbers.1598 : @param $y_average The precomputed AVERAGE over the y_numbers.
1631 : @return The formula result, as numeric type.1599 : @return The formula result, as numeric type.
1632 : @error math:errNA if there are different numbers of x's and y's.1600 : @error math:INVALID_INPUT if there are different numbers of x's and y's.
1633 :)1601 :)
1634declare %private function math:sum-x-y-deviations(1602declare %private function math:sum-x-y-deviations(
1635 $x_numbers as xs:double*, 1603 $x_numbers as double*,
1636 $x_average as xs:double,1604 $x_average as double,
1637 $y_numbers as xs:double*, 1605 $y_numbers as double*,
1638 $y_average as xs:double) as xs:double1606 $y_average as double) as double
1639{1607{
1640 if (fn:empty($x_numbers) and fn:not(fn:empty($y_numbers))) then1608 if (fn:empty($x_numbers) and fn:not(fn:empty($y_numbers))) then
1641 fn:error($math:errNA, "Slope function: different number of x's and y's")1609 fn:error($math:INVALID_INPUT, "Slope function: different number of x's and y's")
1642 else if (fn:empty($y_numbers) and fn:not(fn:empty($x_numbers))) then1610 else if (fn:empty($y_numbers) and fn:not(fn:empty($x_numbers))) then
1643 fn:error($math:errNA, "Slope function: different number of x's and y's")1611 fn:error($math:INVALID_INPUT, "Slope function: different number of x's and y's")
1644 else if (fn:empty($x_numbers) and fn:empty($y_numbers)) then1612 else if (fn:empty($x_numbers) and fn:empty($y_numbers)) then
1645 01613 0
1646 else1614 else
@@ -1652,13 +1620,13 @@
1652};1620};
16531621
1654(:~1622(:~
1655 : Borrowed from excel module.<br/>1623 : Returns the slope of the linear regression line through data points in known_y's and known_x's.<p/>
1656 : Returns the slope of the linear regression line through data points in known_y's and known_x's.
1657 : The slope is the vertical distance divided by the horizontal distance between 1624 : The slope is the vertical distance divided by the horizontal distance between
1658 : any two points on the line, which is the rate of change along the regression line.1625 : any two points on the line, which is the rate of change along the regression line.
1659 : It computes the formula:<br/>1626 : It computes the formula:<p/>
1660 : sum((x - average_x)(y - average_y)) / sum((x - average_x)^2) <br/>1627 : sum((x - average_x)(y - average_y)) / sum((x - average_x)^2)<p/>
1661 : where average_x and average_y are computed with AVERAGE function.1628 : where average_x and average_y are computed with AVERAGE function.<p/>
1629 : Borrowed from excel module.
1662 : 1630 :
1663 : @see http://office.microsoft.com/en-us/excel/HP052092641033.aspx1631 : @see http://office.microsoft.com/en-us/excel/HP052092641033.aspx
1664 : @param $known_y the sequence of y numbers.1632 : @param $known_y the sequence of y numbers.
@@ -1666,57 +1634,57 @@
1666 : @param $known_x the sequence of x numbers.1634 : @param $known_x the sequence of x numbers.
1667 : The sequence can be of any length, from 1 up. 1635 : The sequence can be of any length, from 1 up.
1668 : @return The slope value, as numeric type1636 : @return The slope value, as numeric type
1669 : @error math:errNA if there are different numbers of x's and y's or if the sequence is empty1637 : @error math:INVALID_INPUT if there are different numbers of x's and y's or if the sequence is empty
1670 : @error math:errDiv0 if all x's are equal1638 : @error math:DIVIDE_BY_0 if all x's are equal
1671 : @example test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq1639 : @example test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq
1672:)1640:)
1673declare function math:slope($known_y as xs:double+,1641declare function math:slope($known_y as double+,
1674 $known_x as xs:double+) as xs:double1642 $known_x as double+) as double
1675{1643{
1676 if (fn:empty($known_y) or fn:empty($known_x)) then1644 if (fn:empty($known_y) or fn:empty($known_x)) then
1677 fn:error($math:errNA, "Slope function: known_x and known_y cannot be empty sequences")1645 fn:error($math:INVALID_INPUT, "Slope function: known_x and known_y cannot be empty sequences")
1678 else1646 else
1679 let $x_average := fn:avg($known_x) 1647 let $x_average := fn:avg($known_x)
1680 let $y_average := fn:avg($known_y) 1648 let $y_average := fn:avg($known_y)
1681 let $xsq_dev := math:sumsq-deviations($known_x, $x_average) return1649 let $xsq_dev := math:sumsq-deviations($known_x, $x_average) return
1682 if ($xsq_dev = 0) then1650 if ($xsq_dev eq 0) then
1683 fn:error($math:errDiv0, "Slope function: all x's are equal")1651 fn:error($math:DIVIDE_BY_0, "Slope function: all x's are equal")
1684 else1652 else
1685 let $x_y_dev := math:sum-x-y-deviations($known_x, $x_average, $known_y, $y_average) return1653 let $x_y_dev := math:sum-x-y-deviations($known_x, $x_average, $known_y, $y_average) return
1686 $x_y_dev div $xsq_dev1654 $x_y_dev div $xsq_dev
1687};1655};
16881656
1689(:~1657(:~
1690 : Borrowed from excel module.<br/>1658 : Returns a normalized value from a distribution characterized by mean and standard_dev.<p/>
1691 : Returns a normalized value from a distribution characterized by mean and standard_dev.<br/>1659 : The formula is (x - mean) / standard_dev .<p/>
1692 : The formula is (x - mean) / standard_dev .1660 : Borrowed from excel module.
1693 :1661 :
1694 : @see http://office.microsoft.com/en-us/excel/HP052092731033.aspx1662 : @see http://office.microsoft.com/en-us/excel/HP052092731033.aspx
1695 : @param $x is the value you want to normalize1663 : @param $x is the value you want to normalize
1696 : @param $mean is the arithmetic mean of the distribution.1664 : @param $mean is the arithmetic mean of the distribution.
1697 : @param $standard_dev is the standard deviation of the distribution.1665 : @param $standard_dev is the standard deviation of the distribution.
1698 : @return The normalized x, as numeric type1666 : @return The normalized x, as numeric type
1699 : @error math:errNum if standard_dev is a value smaller than zero or equal1667 : @error math:INVALID_ARGUMENT if standard_dev is a value smaller than zero or equal
1700 : @example test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq1668 : @example test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq
1701:)1669:)
1702declare function math:standardize($x as xs:double,1670declare function math:standardize($x as double,
1703 $mean as xs:double,1671 $mean as double,
1704 $standard_dev as xs:double) as xs:double1672 $standard_dev as double) as double
1705{1673{
1706 if ($standard_dev le 0) then1674 if ($standard_dev le 0) then
1707 fn:error($math:errNum, "Standardize function: standard_dev must be positive ", $standard_dev)1675 fn:error($math:INVALID_ARGUMENT, "Standardize function: standard_dev must be positive ", $standard_dev)
1708 else1676 else
1709 ($x - $mean) div $standard_dev1677 ($x - $mean) div $standard_dev
1710};1678};
17111679
17121680
1713(:~1681(:~
1714 : Borrowed from excel module.<br/>1682 : Estimates standard deviation based on a sample. <p/>
1715 : Estimates standard deviation based on a sample.
1716 : The standard deviation is a measure of how widely values are dispersed 1683 : The standard deviation is a measure of how widely values are dispersed
1717 : from the average value (the mean).1684 : from the average value (the mean).
1718 : It is computed with formula:1685 : It is computed with formula:
1719 : sqrt( sum((x-average_x)^2) / (n-1) ) = sqrt ( VAR(numbers) )1686 : sqrt( sum((x-average_x)^2) / (n-1) ) = sqrt ( VAR(numbers) )<p/>
1687 : Borrowed from excel module.
1720 :1688 :
1721 : @see http://office.microsoft.com/en-us/excel/HP052092771033.aspx1689 : @see http://office.microsoft.com/en-us/excel/HP052092771033.aspx
1722 : @param $numbers the sequence of numbers1690 : @param $numbers the sequence of numbers
@@ -1724,18 +1692,18 @@
1724 : @return the standard deviation, as numeric type1692 : @return the standard deviation, as numeric type
1725 : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq1693 : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq
1726:)1694:)
1727declare function math:stdev($numbers as xs:double+) as xs:double1695declare function math:stdev($numbers as double+) as double
1728{1696{
1729 W3Cmath:sqrt(math:var($numbers))1697 W3Cmath:sqrt(math:var($numbers))
1730};1698};
17311699
1732(:~1700(:~
1733 : Borrowed from excel module.<br/>1701 : Estimates standard deviation based on a sample. <p/>
1734 : Estimates standard deviation based on a sample.
1735 : The standard deviation is a measure of how widely values are dispersed 1702 : The standard deviation is a measure of how widely values are dispersed
1736 : from the average value (the mean).1703 : from the average value (the mean).
1737 : It is computed with formula:1704 : It is computed with formula:
1738 : sqrt( sum((x-average_x)^2) / (n-1) ) = sqrt ( VARA(numbers) )1705 : sqrt( sum((x-average_x)^2) / (n-1) ) = sqrt ( VARA(numbers) )<p/>
1706 : Borrowed from excel module.
1739 :1707 :
1740 : @see http://office.microsoft.com/en-us/excel/HP052092791033.aspx1708 : @see http://office.microsoft.com/en-us/excel/HP052092791033.aspx
1741 : @param $numbers the sequence of numbers.1709 : @param $numbers the sequence of numbers.
@@ -1743,18 +1711,18 @@
1743 : @return the standard deviation, as numeric type1711 : @return the standard deviation, as numeric type
1744 : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq1712 : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq
1745:)1713:)
1746declare function math:stdeva($numbers as xs:double+) as xs:double1714declare function math:stdeva($numbers as double+) as double
1747{1715{
1748 W3Cmath:sqrt(math:vara($numbers))1716 W3Cmath:sqrt(math:vara($numbers))
1749};1717};
17501718
1751(:~1719(:~
1752 : Borrowed from excel module.<br/>1720 : Calculates standard deviation based on the entire population given as arguments. <p/>
1753 : Calculates standard deviation based on the entire population given as arguments.
1754 : The standard deviation is a measure of how widely values are dispersed from 1721 : The standard deviation is a measure of how widely values are dispersed from
1755 : the average value (the mean).1722 : the average value (the mean).
1756 : It is computed with formula:1723 : It is computed with formula:
1757 : sqrt( sum((x-average_x)^2) / n ) = sqrt ( VARP(numbers) )1724 : sqrt( sum((x-average_x)^2) / n ) = sqrt ( VARP(numbers) )<p/>
1725 : Borrowed from excel module.
1758 :1726 :
1759 : @see http://office.microsoft.com/en-us/excel/HP052092811033.aspx1727 : @see http://office.microsoft.com/en-us/excel/HP052092811033.aspx
1760 : @param $numbers the sequence of numbers or values castable to numeric1728 : @param $numbers the sequence of numbers or values castable to numeric
@@ -1762,18 +1730,18 @@
1762 : @return the standard deviation, as numeric type1730 : @return the standard deviation, as numeric type
1763 : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq1731 : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq
1764:)1732:)
1765declare function math:stdevp($numbers as xs:double+) as xs:double1733declare function math:stdevp($numbers as double+) as double
1766{1734{
1767 W3Cmath:sqrt(math:varp($numbers))1735 W3Cmath:sqrt(math:varp($numbers))
1768};1736};
17691737
1770(:~1738(:~
1771 : Borrowed from excel module.<br/>1739 : Calculates standard deviation based on the entire population given as arguments. <p/>
1772 : Calculates standard deviation based on the entire population given as arguments.
1773 : The standard deviation is a measure of how widely values are dispersed from 1740 : The standard deviation is a measure of how widely values are dispersed from
1774 : the average value (the mean).1741 : the average value (the mean).
1775 : It is computed with formula:1742 : It is computed with formula:
1776 : sqrt( sum((x-average_x)^2) / n ) = sqrt ( VARPA(numbers) )1743 : sqrt( sum((x-average_x)^2) / n ) = sqrt ( VARPA(numbers) )<p/>
1744 : Borrowed from excel module.
1777 :1745 :
1778 : @see http://office.microsoft.com/en-us/excel/HP052092831033.aspx1746 : @see http://office.microsoft.com/en-us/excel/HP052092831033.aspx
1779 : @param $numbers the sequence of numbers or values castable to numeric1747 : @param $numbers the sequence of numbers or values castable to numeric
@@ -1781,15 +1749,15 @@
1781 : @return the standard deviation, as numeric type1749 : @return the standard deviation, as numeric type
1782 : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq1750 : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq
1783:)1751:)
1784declare function math:stdevpa($numbers as xs:double+) as xs:double1752declare function math:stdevpa($numbers as double+) as double
1785{1753{
1786 W3Cmath:sqrt(math:varpa($numbers))1754 W3Cmath:sqrt(math:varpa($numbers))
1787};1755};
17881756
1789(:~ 1757(:~
1790 : Borrowed from excel module.<br/>1758 : Returns a subtotal in a sequence of numbers.<p/>
1791 : Returns a subtotal in a sequence of numbers.1759 : The function applied is given by $function_num.<p/>
1792 : The function applied is given by $function_num.1760 : Borrowed from excel module.
1793 : 1761 :
1794 : @see http://office.microsoft.com/en-us/excel/HP052092881033.aspx1762 : @see http://office.microsoft.com/en-us/excel/HP052092881033.aspx
1795 : @param $function_num <dl>defines the function to be applied on sequence values.1763 : @param $function_num <dl>defines the function to be applied on sequence values.
@@ -1811,7 +1779,7 @@
1811 : The sequence can be of any length.1779 : The sequence can be of any length.
1812 : @return The function result, as numeric type1780 : @return The function result, as numeric type
1813 : @error * depends on the function called1781 : @error * depends on the function called
1814 : @error math:errNum if $function_num is not a value between 1 .. 11 or 101 .. 1111782 : @error math:INVALID_ARGUMENT if $function_num is not a value between 1 .. 11 or 101 .. 111
1815 : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq1783 : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq
1816 : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq1784 : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq
1817 : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq1785 : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq
@@ -1824,40 +1792,40 @@
1824 : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq1792 : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq
1825 : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq1793 : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq
1826:)1794:)
1827declare function math:subtotal($function_num as xs:integer, $numbers as xs:double*) as xs:double1795declare function math:subtotal($function_num as integer, $numbers as double*) as double
1828{1796{
1829 if ($function_num = 1 or $function_num = 101) then1797 if ($function_num eq 1 or $function_num eq 101) then
1830 fn:avg($numbers)1798 fn:avg($numbers)
1831 else 1799 else
1832 if ($function_num = 2 or $function_num = 102) then1800 if ($function_num eq 2 or $function_num eq 102) then
1833 fn:count($numbers)1801 fn:count($numbers)
1834 else1802 else
1835 if ($function_num = 3 or $function_num = 103) then1803 if ($function_num eq 3 or $function_num eq 103) then
1836 fn:count($numbers)1804 fn:count($numbers)
1837 else1805 else
1838 if ($function_num = 4 or $function_num = 104) then1806 if ($function_num eq 4 or $function_num eq 104) then
1839 fn:max($numbers)1807 fn:max($numbers)
1840 else1808 else
1841 if ($function_num = 5 or $function_num = 105) then1809 if ($function_num eq 5 or $function_num eq 105) then
1842 fn:min($numbers)1810 fn:min($numbers)
1843 else1811 else
1844 if ($function_num = 6 or $function_num = 106) then1812 if ($function_num eq 6 or $function_num eq 106) then
1845 math:product($numbers)1813 math:product($numbers)
1846 else1814 else
1847 if ($function_num = 7 or $function_num = 107) then1815 if ($function_num eq 7 or $function_num eq 107) then
1848 math:stdev($numbers)1816 math:stdev($numbers)
1849 else1817 else
1850 if ($function_num = 8 or $function_num = 108) then1818 if ($function_num eq 8 or $function_num eq 108) then
1851 math:stdevp($numbers)1819 math:stdevp($numbers)
1852 else1820 else
1853 if ($function_num = 9 or $function_num = 109) then1821 if ($function_num eq 9 or $function_num eq 109) then
1854 fn:sum($numbers)1822 fn:sum($numbers)
1855 else1823 else
1856 if ($function_num = 10 or $function_num = 110) then1824 if ($function_num eq 10 or $function_num eq 110) then
1857 math:var($numbers)1825 math:var($numbers)
1858 else1826 else
1859 if ($function_num = 11 or $function_num = 111) then1827 if ($function_num eq 11 or $function_num eq 111) then
1860 math:varp($numbers)1828 math:varp($numbers)
1861 else1829 else
1862 fn:error($math:errNum, "Subtotal function: function_num should be between 1 and 11 or 101 and 111")1830 fn:error($math:INVALID_ARGUMENT, "Subtotal function: function_num should be between 1 and 11 or 101 and 111")
1863};1831};
18641832
=== renamed file 'modules/com/zorba-xquery/www/modules/random.xq' => 'modules/atomic/random.xq'
--- modules/com/zorba-xquery/www/modules/random.xq 2013-06-25 03:55:20 +0000
+++ modules/atomic/random.xq 2013-07-17 15:56:30 +0000
@@ -1,7 +1,7 @@
1xquery version "3.0";1jsoniq version "1.0";
22
3(:3(:
4 : Copyright 2006-2009 The FLWOR Foundation.4 : Copyright 2006-2013 The FLWOR Foundation.
5 :5 :
6 : Licensed under the Apache License, Version 2.0 (the "License");6 : Licensed under the Apache License, Version 2.0 (the "License");
7 : you may not use this file except in compliance with the License.7 : you may not use this file except in compliance with the License.
@@ -24,18 +24,21 @@
24 : @project Zorba/XQuery Data Model/Atomic/Random24 : @project Zorba/XQuery Data Model/Atomic/Random
25 :25 :
26 :)26 :)
27module namespace r = "http://www.zorba-xquery.com/modules/random";27module namespace r = "http://zorba.io/modules/random";
2828
29declare namespace an = "http://www.zorba-xquery.com/annotations";29declare namespace an = "http://www.zorba-xquery.com/annotations";
30declare namespace zerr = "http://zorba.io/modules/zorba-errors";30declare namespace zerr = "http://zorba.io/modules/zorba-errors";
3131
32declare namespace ver = "http://www.zorba-xquery.com/options/versioning";32declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
33declare option ver:module-version "2.0";33declare option ver:module-version "1.0";
34
35declare %private variable $r:errNS as string := "http://zorba.io/modules/random";
36declare %private variable $r:INVALID_ARGUMENT as QName := fn:QName($r:errNS, "r:INVALID_ARGUMENT");
3437
35(:~38(:~
36 : This function generates an arbitrary number of pseudo-random numbers.39 : <p>This function generates an arbitrary number of pseudo-random numbers.
37 : The sequence is repeatable by calling the function with the same40 : The sequence is repeatable by calling the function with the same
38 : seed.41 : seed.</p>
39 :42 :
40 : <p>The function is based on posix function <tt>srand()</tt> and43 : <p>The function is based on posix function <tt>srand()</tt> and
41 : <tt>rand()</tt>. Specifically, it invokes <tt>srand($seed)</tt>44 : <tt>rand()</tt>. Specifically, it invokes <tt>srand($seed)</tt>
@@ -56,14 +59,14 @@
56 : than the max value of <tt>unsigned int</tt> on the given platform.59 : than the max value of <tt>unsigned int</tt> on the given platform.
57 :)60 :)
58declare function r:seeded-random(61declare function r:seeded-random(
59 $seed as xs:integer,62 $seed as integer,
60 $num as xs:integer63 $num as integer
61) as xs:integer* external;64) as integer* external;
6265
63(:~66(:~
64 : This function generates an arbitrary number of random numbers.67 : <p>This function generates an arbitrary number of random numbers.
65 : The function is nondeterministic because the sequence is68 : The function is nondeterministic because the sequence is
66 : <b>not</b> repeatable.69 : <b>not</b> repeatable.</p>
67 :70 :
68 : <p>However, the function is based on posix function <tt>srand()</tt> and71 : <p>However, the function is based on posix function <tt>srand()</tt> and
69 : <tt>rand()</tt>. Specifically, it invokes <tt>srand()</tt>72 : <tt>rand()</tt>. Specifically, it invokes <tt>srand()</tt>
@@ -76,30 +79,30 @@
76 : sequence if <tt>$num</tt> is negative.79 : sequence if <tt>$num</tt> is negative.
77 :)80 :)
78declare %an:nondeterministic function r:random(81declare %an:nondeterministic function r:random(
79 $num as xs:integer82 $num as integer
80) as xs:integer* external;83) as integer* external;
8184
82(:~85(:~
83 : This function generates one random number.86 : <p>This function generates one random number.
84 : The function is nondeterministic.87 : The function is nondeterministic.</p>
85 :88 :
86 : <p>The function is based on <tt>r:random#1</tt>. Specifically, it89 : <p>The function is based on <tt>r:random#1</tt>. Specifically, it
87 : returns the value of invoking <tt>r:random(1)</tt>.</p>90 : returns the value of invoking <tt>r:random(1)</tt>.</p>
88 :91 :
89 : @return a random integer92 : @return a random integer
90 :)93 :)
91declare %an:nondeterministic function r:random() as xs:integer94declare %an:nondeterministic function r:random() as integer
92{95{
93 r:random(1)96 r:random(1)
94};97};
9598
96(:~99(:~
97 : This function generates an arbitrary number of pseudo-random numbers100 : <p>This function generates an arbitrary number of pseudo-random numbers
98 : within a given range. The sequence is repeatable by calling the101 : within a given range. The sequence is repeatable by calling the
99 : function with the same seed and boundaries.102 : function with the same seed and boundaries.</p>
100 :103 :
101 : <p>The function is based on the function <tt>r:seeded-random#2</tt>.104 : <p>The function is based on the function <tt>r:seeded-random#2</tt>.
102 : Specifically, it's result is repeatable if called with the105 : Specifically, its result is repeatable if called with the
103 : same arguments.</p>106 : same arguments.</p>
104 :107 :
105 : @param $seed the initial seed value for the sequence108 : @param $seed the initial seed value for the sequence
@@ -114,37 +117,37 @@
114 :117 :
115 : @error zerr:ZQXD0004 if the given seed is negative or great118 : @error zerr:ZQXD0004 if the given seed is negative or great
116 : than the max value of <tt>unsigned int</tt> on the given platform.119 : than the max value of <tt>unsigned int</tt> on the given platform.
117 : @error r:invalid-arg if <tt>$lower</tt> is greater than <tt>$upper</tt>120 : @error r:INVALID_ARGUMENT if <tt>$lower</tt> is greater than <tt>$upper</tt>
118 :)121 :)
119declare function r:seeded-random-between(122declare function r:seeded-random-between(
120 $seed as xs:integer,123 $seed as integer,
121 $lower as xs:integer,124 $lower as integer,
122 $upper as xs:integer,125 $upper as integer,
123 $num as xs:integer126 $num as integer
124) as xs:integer*127) as integer*
125{128{
126 if ( $lower eq $upper ) then129 if ( $lower eq $upper ) then
127 $lower130 $lower
128 else131 else
129 if ( $lower > $upper ) then132 if ( $lower gt $upper ) then
130 fn:error(133 fn:error(
131 fn:QName("http://www.zorba-xquery.com/modules/random", "invalid-arg"),134 $r:INVALID_ARGUMENT,
132 "$lower must be smaller or equal than $upper",135 "$lower must be less than or equal to $upper",
133 ($lower, $upper)136 ($lower, $upper)
134 )137 )
135 else138 else
136 for $i in r:seeded-random( $seed, $num )139 for $i in r:seeded-random( $seed, $num )
137 return140 return
138 if ( ( $upper - $lower ) lt 10000 ) then141 if ( ( $upper - $lower ) lt 10000 ) then
139 xs:integer( fn:round( xs:double( $i mod 10000 ) div 10000 * ( $upper - $lower) ) + $lower )142 integer( fn:round( double( $i mod 10000 ) div 10000 * ( $upper - $lower) ) + $lower )
140 else143 else
141 xs:integer( fn:round( xs:double( $i ) mod ( $upper - $lower ) ) + $lower )144 integer( fn:round( double( $i ) mod ( $upper - $lower ) ) + $lower )
142};145};
143146
144(:~147(:~
145 : This function generates an arbitrary number of random numbers148 : <p>This function generates an arbitrary number of random numbers
146 : within a given range. The function is nondeterministic because149 : within a given range. The function is nondeterministic because
147 : the sequence is <b>not</b> repeatable.150 : the sequence is <b>not</b> repeatable.</p>
148 :151 :
149 : @param $lower the lower bound for every value within the sequence152 : @param $lower the lower bound for every value within the sequence
150 : @param $upper the upper bound for every value within the sequence153 : @param $upper the upper bound for every value within the sequence
@@ -155,34 +158,34 @@
155 : equal to <tt>$upper</tt> and the empty sequence if <tt>$num</tt>158 : equal to <tt>$upper</tt> and the empty sequence if <tt>$num</tt>
156 : is negative.159 : is negative.
157 :160 :
158 : @error r:invalid-arg if <tt>$lower</tt> is greater than <tt>$upper</tt>161 : @error r:INVALID_ARGUMENT if <tt>$lower</tt> is greater than <tt>$upper</tt>
159 :)162 :)
160declare %an:nondeterministic function r:random-between(163declare %an:nondeterministic function r:random-between(
161 $lower as xs:integer,164 $lower as integer,
162 $upper as xs:integer,165 $upper as integer,
163 $num as xs:integer) as xs:integer*166 $num as integer) as integer*
164{167{
165 if ( $lower eq $upper ) then168 if ( $lower eq $upper ) then
166 $lower169 $lower
167 else170 else
168 if ( $lower > $upper ) then171 if ( $lower gt $upper ) then
169 fn:error(172 fn:error(
170 fn:QName("http://www.zorba-xquery.com/modules/random", "invalid-arg"),173 $r:INVALID_ARGUMENT,
171 "$lower must be smaller or equal than $upper",174 "$lower must be less than or equal to $upper",
172 ($lower, $upper)175 ($lower, $upper)
173 )176 )
174 else177 else
175 for $i in r:random( $num )178 for $i in r:random( $num )
176 return179 return
177 if ( ( $upper - $lower ) lt 10000 ) then180 if ( ( $upper - $lower ) lt 10000 ) then
178 xs:integer( fn:round( xs:double( $i mod 10000 ) div 10000 * ( $upper - $lower) ) + $lower )181 integer( fn:round( double( $i mod 10000 ) div 10000 * ( $upper - $lower) ) + $lower )
179 else182 else
180 xs:integer( fn:round( xs:double( $i ) mod ( $upper - $lower ) ) + $lower )183 integer( fn:round( double( $i ) mod ( $upper - $lower ) ) + $lower )
181};184};
182185
183(:~186(:~
184 : This function generates one random number within a given range.187 : <p>This function generates one random number within a given range.
185 : The function is nondeterministic.188 : The function is nondeterministic.</p>
186 :189 :
187 : <p>The function is based on <tt>r:random-between#3</tt>.190 : <p>The function is based on <tt>r:random-between#3</tt>.
188 : Specifically, it returns the value of invoking191 : Specifically, it returns the value of invoking
@@ -193,18 +196,19 @@
193 : @return a random integer within the given range196 : @return a random integer within the given range
194 :)197 :)
195declare %an:nondeterministic function r:random-between(198declare %an:nondeterministic function r:random-between(
196 $lower as xs:integer,199 $lower as integer,
197 $upper as xs:integer200 $upper as integer
198) as xs:integer201) as integer
199{202{
200 r:random-between($lower, $upper, 1)203 r:random-between($lower, $upper, 1)
201};204};
202205
203(:~206(:~
204 : This function returns a uuid. Note, that the function is not stable,207 : <p>This function returns a uuid.</p>
205 : that is, it returns a different UUID everytime the function is invoked.208 : <p> Note, that the function is not stable,
209 : that is, it returns a different UUID everytime the function is invoked.</p>
206 :210 :
207 : @return the generated UUID as xs:string211 : @return the generated UUID as string
208:)212:)
209declare %an:nondeterministic function r:uuid() as xs:string external;213declare %an:nondeterministic function r:uuid() as string external;
210214
211215
=== removed directory 'modules/base64'
=== removed file 'modules/base64/CMakeLists.txt'
--- modules/base64/CMakeLists.txt 2013-07-17 07:20:31 +0000
+++ modules/base64/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
1# Copyright 2013 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15DECLARE_ZORBA_MODULE(FILE base64.xq VERSION 1.0
16 URI "http://zorba.io/modules/base64")
170
=== modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt'
--- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2013-07-17 07:20:31 +0000
+++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2013-07-17 15:56:30 +0000
@@ -56,8 +56,6 @@
56 URI "http://www.zorba-xquery.com/modules/datetime")56 URI "http://www.zorba-xquery.com/modules/datetime")
57DECLARE_ZORBA_MODULE(FILE fetch.xq VERSION 2.057DECLARE_ZORBA_MODULE(FILE fetch.xq VERSION 2.0
58 URI "http://www.zorba-xquery.com/modules/fetch")58 URI "http://www.zorba-xquery.com/modules/fetch")
59DECLARE_ZORBA_MODULE(FILE math.xq VERSION 2.0
60 URI "http://www.zorba-xquery.com/modules/math")
61DECLARE_ZORBA_MODULE(FILE node-reference.xq VERSION 2.059DECLARE_ZORBA_MODULE(FILE node-reference.xq VERSION 2.0
62 URI "http://www.zorba-xquery.com/modules/node-reference")60 URI "http://www.zorba-xquery.com/modules/node-reference")
63DECLARE_ZORBA_MODULE(FILE reference.xq VERSION 1.061DECLARE_ZORBA_MODULE(FILE reference.xq VERSION 1.0
@@ -66,8 +64,6 @@
66 URI "http://www.zorba-xquery.com/modules/node")64 URI "http://www.zorba-xquery.com/modules/node")
67DECLARE_ZORBA_MODULE(FILE item.xq VERSION 1.065DECLARE_ZORBA_MODULE(FILE item.xq VERSION 1.0
68 URI "http://www.zorba-xquery.com/modules/item")66 URI "http://www.zorba-xquery.com/modules/item")
69DECLARE_ZORBA_MODULE(FILE random.xq VERSION 2.0
70 URI "http://www.zorba-xquery.com/modules/random")
71DECLARE_ZORBA_MODULE(FILE reflection.xq VERSION 2.067DECLARE_ZORBA_MODULE(FILE reflection.xq VERSION 2.0
72 URI "http://www.zorba-xquery.com/modules/reflection")68 URI "http://www.zorba-xquery.com/modules/reflection")
73DECLARE_ZORBA_MODULE(FILE schema.xq VERSION 2.069DECLARE_ZORBA_MODULE(FILE schema.xq VERSION 2.0
7470
=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp 2013-07-17 07:20:31 +0000
+++ src/context/static_context.cpp 2013-07-17 15:56:30 +0000
@@ -353,7 +353,7 @@
353353
354const char*354const char*
355static_context::ZORBA_MATH_FN_NS =355static_context::ZORBA_MATH_FN_NS =
356"http://www.zorba-xquery.com/modules/math";356"http://zorba.io/modules/math";
357357
358const char*358const char*
359static_context::ZORBA_BASE64_FN_NS =359static_context::ZORBA_BASE64_FN_NS =
@@ -433,7 +433,7 @@
433433
434const char*434const char*
435static_context::ZORBA_RANDOM_FN_NS =435static_context::ZORBA_RANDOM_FN_NS =
436"http://www.zorba-xquery.com/modules/random";436"http://zorba.io/modules/random";
437437
438const char*438const char*
439static_context::ZORBA_INTROSP_SCTX_FN_NS =439static_context::ZORBA_INTROSP_SCTX_FN_NS =
440440
=== modified file 'src/functions/pregenerated/func_maths.cpp'
--- src/functions/pregenerated/func_maths.cpp 2013-03-05 23:11:50 +0000
+++ src/functions/pregenerated/func_maths.cpp 2013-07-17 15:56:30 +0000
@@ -442,7 +442,7 @@
442442
443 {443 {
444 DECL_WITH_KIND(sctx, fn_zorba_math_cosh,444 DECL_WITH_KIND(sctx, fn_zorba_math_cosh,
445 (createQName("http://www.zorba-xquery.com/modules/math","","cosh"), 445 (createQName("http://zorba.io/modules/math","","cosh"),
446 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 446 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
447 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),447 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),
448 FunctionConsts::FN_ZORBA_MATH_COSH_1);448 FunctionConsts::FN_ZORBA_MATH_COSH_1);
@@ -454,7 +454,7 @@
454454
455 {455 {
456 DECL_WITH_KIND(sctx, fn_zorba_math_acosh,456 DECL_WITH_KIND(sctx, fn_zorba_math_acosh,
457 (createQName("http://www.zorba-xquery.com/modules/math","","acosh"), 457 (createQName("http://zorba.io/modules/math","","acosh"),
458 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 458 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
459 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),459 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),
460 FunctionConsts::FN_ZORBA_MATH_ACOSH_1);460 FunctionConsts::FN_ZORBA_MATH_ACOSH_1);
@@ -466,7 +466,7 @@
466466
467 {467 {
468 DECL_WITH_KIND(sctx, fn_zorba_math_fmod,468 DECL_WITH_KIND(sctx, fn_zorba_math_fmod,
469 (createQName("http://www.zorba-xquery.com/modules/math","","fmod"), 469 (createQName("http://zorba.io/modules/math","","fmod"),
470 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 470 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
471 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 471 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
472 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),472 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),
@@ -479,7 +479,7 @@
479479
480 {480 {
481 DECL_WITH_KIND(sctx, fn_zorba_math_ldexp,481 DECL_WITH_KIND(sctx, fn_zorba_math_ldexp,
482 (createQName("http://www.zorba-xquery.com/modules/math","","ldexp"), 482 (createQName("http://zorba.io/modules/math","","ldexp"),
483 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 483 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
484 GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 484 GENV_TYPESYSTEM.INTEGER_TYPE_ONE,
485 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),485 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),
@@ -505,7 +505,7 @@
505505
506 {506 {
507 DECL_WITH_KIND(sctx, fn_zorba_math_sinh,507 DECL_WITH_KIND(sctx, fn_zorba_math_sinh,
508 (createQName("http://www.zorba-xquery.com/modules/math","","sinh"), 508 (createQName("http://zorba.io/modules/math","","sinh"),
509 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 509 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
510 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),510 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),
511 FunctionConsts::FN_ZORBA_MATH_SINH_1);511 FunctionConsts::FN_ZORBA_MATH_SINH_1);
@@ -517,7 +517,7 @@
517517
518 {518 {
519 DECL_WITH_KIND(sctx, fn_zorba_math_asinh,519 DECL_WITH_KIND(sctx, fn_zorba_math_asinh,
520 (createQName("http://www.zorba-xquery.com/modules/math","","asinh"), 520 (createQName("http://zorba.io/modules/math","","asinh"),
521 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 521 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
522 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),522 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),
523 FunctionConsts::FN_ZORBA_MATH_ASINH_1);523 FunctionConsts::FN_ZORBA_MATH_ASINH_1);
@@ -529,7 +529,7 @@
529529
530 {530 {
531 DECL_WITH_KIND(sctx, fn_zorba_math_tanh,531 DECL_WITH_KIND(sctx, fn_zorba_math_tanh,
532 (createQName("http://www.zorba-xquery.com/modules/math","","tanh"), 532 (createQName("http://zorba.io/modules/math","","tanh"),
533 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 533 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
534 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),534 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),
535 FunctionConsts::FN_ZORBA_MATH_TANH_1);535 FunctionConsts::FN_ZORBA_MATH_TANH_1);
@@ -541,7 +541,7 @@
541541
542 {542 {
543 DECL_WITH_KIND(sctx, fn_zorba_math_atanh,543 DECL_WITH_KIND(sctx, fn_zorba_math_atanh,
544 (createQName("http://www.zorba-xquery.com/modules/math","","atanh"), 544 (createQName("http://zorba.io/modules/math","","atanh"),
545 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 545 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
546 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),546 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),
547 FunctionConsts::FN_ZORBA_MATH_ATANH_1);547 FunctionConsts::FN_ZORBA_MATH_ATANH_1);
@@ -564,7 +564,7 @@
564564
565 {565 {
566 DECL_WITH_KIND(sctx, fn_zorba_math_is_inf,566 DECL_WITH_KIND(sctx, fn_zorba_math_is_inf,
567 (createQName("http://www.zorba-xquery.com/modules/math","","is_inf"), 567 (createQName("http://zorba.io/modules/math","","is_inf"),
568 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 568 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
569 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),569 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
570 FunctionConsts::FN_ZORBA_MATH_IS_INF_1);570 FunctionConsts::FN_ZORBA_MATH_IS_INF_1);
@@ -576,7 +576,7 @@
576576
577 {577 {
578 DECL_WITH_KIND(sctx, fn_zorba_math_is_nan,578 DECL_WITH_KIND(sctx, fn_zorba_math_is_nan,
579 (createQName("http://www.zorba-xquery.com/modules/math","","is_nan"), 579 (createQName("http://zorba.io/modules/math","","is_nan"),
580 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 580 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
581 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),581 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
582 FunctionConsts::FN_ZORBA_MATH_IS_NAN_1);582 FunctionConsts::FN_ZORBA_MATH_IS_NAN_1);
@@ -588,7 +588,7 @@
588588
589 {589 {
590 DECL_WITH_KIND(sctx, fn_zorba_math_modf,590 DECL_WITH_KIND(sctx, fn_zorba_math_modf,
591 (createQName("http://www.zorba-xquery.com/modules/math","","modf"), 591 (createQName("http://zorba.io/modules/math","","modf"),
592 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 592 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
593 GENV_TYPESYSTEM.DOUBLE_TYPE_PLUS),593 GENV_TYPESYSTEM.DOUBLE_TYPE_PLUS),
594 FunctionConsts::FN_ZORBA_MATH_MODF_1);594 FunctionConsts::FN_ZORBA_MATH_MODF_1);
@@ -600,7 +600,7 @@
600600
601 {601 {
602 DECL_WITH_KIND(sctx, fn_zorba_math_frexp,602 DECL_WITH_KIND(sctx, fn_zorba_math_frexp,
603 (createQName("http://www.zorba-xquery.com/modules/math","","frexp"), 603 (createQName("http://zorba.io/modules/math","","frexp"),
604 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 604 GENV_TYPESYSTEM.DOUBLE_TYPE_ONE,
605 GENV_TYPESYSTEM.DOUBLE_TYPE_PLUS),605 GENV_TYPESYSTEM.DOUBLE_TYPE_PLUS),
606 FunctionConsts::FN_ZORBA_MATH_FREXP_1);606 FunctionConsts::FN_ZORBA_MATH_FREXP_1);
607607
=== modified file 'src/functions/pregenerated/func_random.cpp'
--- src/functions/pregenerated/func_random.cpp 2013-03-05 23:11:50 +0000
+++ src/functions/pregenerated/func_random.cpp 2013-07-17 15:56:30 +0000
@@ -67,7 +67,7 @@
6767
68 {68 {
69 DECL_WITH_KIND(sctx, fn_zorba_random_seeded_random,69 DECL_WITH_KIND(sctx, fn_zorba_random_seeded_random,
70 (createQName("http://www.zorba-xquery.com/modules/random","","seeded-random"), 70 (createQName("http://zorba.io/modules/random","","seeded-random"),
71 GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 71 GENV_TYPESYSTEM.INTEGER_TYPE_ONE,
72 GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 72 GENV_TYPESYSTEM.INTEGER_TYPE_ONE,
73 GENV_TYPESYSTEM.INTEGER_TYPE_STAR),73 GENV_TYPESYSTEM.INTEGER_TYPE_STAR),
@@ -80,7 +80,7 @@
8080
81 {81 {
82 DECL_WITH_KIND(sctx, fn_zorba_random_random,82 DECL_WITH_KIND(sctx, fn_zorba_random_random,
83 (createQName("http://www.zorba-xquery.com/modules/random","","random"), 83 (createQName("http://zorba.io/modules/random","","random"),
84 GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 84 GENV_TYPESYSTEM.INTEGER_TYPE_ONE,
85 GENV_TYPESYSTEM.INTEGER_TYPE_STAR),85 GENV_TYPESYSTEM.INTEGER_TYPE_STAR),
86 FunctionConsts::FN_ZORBA_RANDOM_RANDOM_1);86 FunctionConsts::FN_ZORBA_RANDOM_RANDOM_1);
@@ -103,7 +103,7 @@
103103
104 {104 {
105 DECL_WITH_KIND(sctx, fn_zorba_util_uuid,105 DECL_WITH_KIND(sctx, fn_zorba_util_uuid,
106 (createQName("http://www.zorba-xquery.com/modules/random","","uuid"), 106 (createQName("http://zorba.io/modules/random","","uuid"),
107 GENV_TYPESYSTEM.STRING_TYPE_ONE),107 GENV_TYPESYSTEM.STRING_TYPE_ONE),
108 FunctionConsts::FN_ZORBA_RANDOM_UUID_0);108 FunctionConsts::FN_ZORBA_RANDOM_UUID_0);
109109
110110
=== modified file 'src/runtime/spec/mappings.xml'
--- src/runtime/spec/mappings.xml 2013-07-17 07:20:31 +0000
+++ src/runtime/spec/mappings.xml 2013-07-17 15:56:30 +0000
@@ -12,7 +12,7 @@
12 define="XQUERY_MATH_FN_NS"12 define="XQUERY_MATH_FN_NS"
13 prefix="math"/>13 prefix="math"/>
1414
15 <zorba:namespace uri="http://www.zorba-xquery.com/modules/math"15 <zorba:namespace uri="http://zorba.io/modules/math"
16 define="ZORBA_MATH_FN_NS"16 define="ZORBA_MATH_FN_NS"
17 prefix="fn-zorba-math"/>17 prefix="fn-zorba-math"/>
1818
@@ -94,7 +94,7 @@
94 define="ZORBA_XQDOC_FN_NS" 94 define="ZORBA_XQDOC_FN_NS"
95 prefix="fn-zorba-xqdoc"/>95 prefix="fn-zorba-xqdoc"/>
9696
97 <zorba:namespace uri="http://www.zorba-xquery.com/modules/random" 97 <zorba:namespace uri="http://zorba.io/modules/random"
98 define="ZORBA_RANDOM_FN_NS" 98 define="ZORBA_RANDOM_FN_NS"
99 prefix="fn-zorba-random"/>99 prefix="fn-zorba-random"/>
100100
101101
=== modified file 'test/rbkt/ExpQueryResults/zorba/random/seeded-random-between1.xml.res'
--- test/rbkt/ExpQueryResults/zorba/random/seeded-random-between1.xml.res 2013-02-07 17:24:36 +0000
+++ test/rbkt/ExpQueryResults/zorba/random/seeded-random-between1.xml.res 2013-07-17 15:56:30 +0000
@@ -1,1 +1,1 @@
1true true $lower must be smaller or equal than $upper 4 11true true $lower must be less than or equal to $upper 4 1
22
=== modified file 'test/rbkt/Queries/zorba/annotations/annot-err-05.xq'
--- test/rbkt/Queries/zorba/annotations/annot-err-05.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/annotations/annot-err-05.xq 2013-07-17 15:56:30 +0000
@@ -1,6 +1,6 @@
1declare namespace ann = "http://www.zorba-xquery.com/annotations";1declare namespace ann = "http://www.zorba-xquery.com/annotations";
22
3declare namespace random = "http://www.zorba-xquery.com/modules/random";3declare namespace random = "http://zorba.io/modules/random";
44
5declare %ann:deterministic %ann:deterministic function random:random() as xs:integer external;5declare %ann:deterministic %ann:deterministic function random:random() as xs:integer external;
66
77
=== modified file 'test/rbkt/Queries/zorba/annotations/annot-err-06.xq'
--- test/rbkt/Queries/zorba/annotations/annot-err-06.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/annotations/annot-err-06.xq 2013-07-17 15:56:30 +0000
@@ -1,6 +1,6 @@
1declare namespace ann = "http://www.zorba-xquery.com/annotations";1declare namespace ann = "http://www.zorba-xquery.com/annotations";
22
3declare namespace random = "http://www.zorba-xquery.com/modules/random";3declare namespace random = "http://zorba.io/modules/random";
44
5declare %ann:nondeterministic %ann:nondeterministic function random:random() as xs:integer external;5declare %ann:nondeterministic %ann:nondeterministic function random:random() as xs:integer external;
66
77
=== modified file 'test/rbkt/Queries/zorba/annotations/annot-err-07.xq'
--- test/rbkt/Queries/zorba/annotations/annot-err-07.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/annotations/annot-err-07.xq 2013-07-17 15:56:30 +0000
@@ -1,6 +1,6 @@
1declare namespace ann = "http://www.zorba-xquery.com/annotations";1declare namespace ann = "http://www.zorba-xquery.com/annotations";
22
3declare namespace random = "http://www.zorba-xquery.com/modules/random";3declare namespace random = "http://zorba.io/modules/random";
44
5declare %ann:deterministic %ann:nondeterministic function random:random() as xs:integer external;5declare %ann:deterministic %ann:nondeterministic function random:random() as xs:integer external;
66
77
=== modified file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_02.xq'
--- test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_02.xq 2012-09-19 19:47:50 +0000
+++ test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_02.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace f = "http://expath.org/ns/file";1import module namespace f = "http://expath.org/ns/file";
2import module namespace r = "http://www.zorba-xquery.com/modules/random";2import module namespace r = "http://zorba.io/modules/random";
33
4import schema namespace o = "http://www.w3.org/2010/xslt-xquery-serialization";4import schema namespace o = "http://www.w3.org/2010/xslt-xquery-serialization";
55
66
=== modified file 'test/rbkt/Queries/zorba/math/acosh1.xq'
--- test/rbkt/Queries/zorba/math/acosh1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/acosh1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:acosh(8723321.4)3fn-zorba-math:acosh(8723321.4)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/math/asinh1.xq'
--- test/rbkt/Queries/zorba/math/asinh1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/asinh1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:asinh(8723321.4)3fn-zorba-math:asinh(8723321.4)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/math/atanh1.xq'
--- test/rbkt/Queries/zorba/math/atanh1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/atanh1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:atanh(0.3)3fn-zorba-math:atanh(0.3)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/math/cosh1.xq'
--- test/rbkt/Queries/zorba/math/cosh1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/cosh1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:cosh(7.104760e+002)3fn-zorba-math:cosh(7.104760e+002)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/math/cosh2.xq'
--- test/rbkt/Queries/zorba/math/cosh2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/cosh2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1declare namespace math="http://www.w3.org/2005/xpath-functions/math";1declare namespace math="http://www.w3.org/2005/xpath-functions/math";
2import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";2import module namespace fn-zorba-math = "http://zorba.io/modules/math";
33
4fn-zorba-math:cosh(math:log(2))4fn-zorba-math:cosh(math:log(2))
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'test/rbkt/Queries/zorba/math/deg-to-rad.xq'
--- test/rbkt/Queries/zorba/math/deg-to-rad.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/deg-to-rad.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1(: test for bug #3079279 :)1(: test for bug #3079279 :)
2import module namespace math="http://www.zorba-xquery.com/modules/math";2import module namespace math="http://zorba.io/modules/math";
33
4math:deg-to-rad(10)4math:deg-to-rad(10)
55
=== modified file 'test/rbkt/Queries/zorba/math/fmod1.xq'
--- test/rbkt/Queries/zorba/math/fmod1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/fmod1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:fmod(-10, 3)3fn-zorba-math:fmod(-10, 3)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/math/fmod2.xq'
--- test/rbkt/Queries/zorba/math/fmod2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/fmod2.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:fmod(2.3, 1.1)3fn-zorba-math:fmod(2.3, 1.1)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/math/fmod3.xq'
--- test/rbkt/Queries/zorba/math/fmod3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/fmod3.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:fmod(-10, 0)3fn-zorba-math:fmod(-10, 0)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/math/frexp1.xq'
--- test/rbkt/Queries/zorba/math/frexp1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/frexp1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:frexp(16.4)3fn-zorba-math:frexp(16.4)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:avedev((4, 5, 6, 7, 5, 4, 3))4math:avedev((4, 5, 6, 7, 5, 4, 3))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:ceiling(2.5, 1)4math:ceiling(2.5, 1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:ceiling(-2.5, -2)4math:ceiling(-2.5, -2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.spec'
--- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.spec 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.spec 2013-07-17 15:56:30 +0000
@@ -1,1 +1,1 @@
1Error: http://www.zorba-xquery.com/modules/math:Num1Error: http://zorba.io/modules/math:INVALID_ARGUMENT
22
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:ceiling(-2.5, 2)4math:ceiling(-2.5, 2)
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:ceiling(1.5, 0.1)4math:ceiling(1.5, 0.1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:ceiling(0.234, 0.01)4math:ceiling(0.234, 0.01)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling6.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling6.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling6.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:ceiling(-20.1, -20.2)4math:ceiling(-20.1, -20.2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:ceiling(0.6, 5E-1)4math:ceiling(0.6, 5E-1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_even1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_even1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:even(1.5)4math:even(1.5)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_even2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_even2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:even(3)4math:even(3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_even3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_even3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:even(2)4math:even(2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_even4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_even4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:even(-1)4math:even(-1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:even(2.5)4math:even(2.5)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:even(0)4math:even(0)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:fact(5)4math:fact(5)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:fact(1)4math:fact(1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:fact(0)4math:fact(0)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact4.spec'
--- test/rbkt/Queries/zorba/math/from_excel/excel_fact4.spec 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_fact4.spec 2013-07-17 15:56:30 +0000
@@ -1,1 +1,1 @@
1Error: http://www.zorba-xquery.com/modules/math:Num1Error: http://zorba.io/modules/math:INVALID_ARGUMENT
22
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:fact(-1)4math:fact(-1)
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:fact(1)4math:fact(1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:factdouble(6)4math:factdouble(6)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:factdouble(7)4math:factdouble(7)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:floor(2.5, 1)4math:floor(2.5, 1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:floor(-2.5, -2)4math:floor(-2.5, -2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor3.spec'
--- test/rbkt/Queries/zorba/math/from_excel/excel_floor3.spec 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_floor3.spec 2013-07-17 15:56:30 +0000
@@ -1,1 +1,1 @@
1Error: http://www.zorba-xquery.com/modules/math:Num1Error: http://zorba.io/modules/math:INVALID_ARGUMENT
22
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:floor(-2.5, 2)4math:floor(-2.5, 2)
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_floor4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_floor4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:floor(1.5, 0.1)4math:floor(1.5, 0.1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:floor(0.234, 0.01)4math:floor(0.234, 0.01)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor6.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_floor6.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_floor6.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4(1.31 - math:floor(1.31, 0.2)) ge 0.14(1.31 - math:floor(1.31, 0.2)) ge 0.1
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:gcd((5, 2))4math:gcd((5, 2))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:gcd((24, 36))4math:gcd((24, 36))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:gcd((7, 1))4math:gcd((7, 1))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_gcd4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:gcd((5, 0))4math:gcd((5, 0))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_gcd5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:gcd((13, 17, 23, 29))4math:gcd((13, 17, 23, 29))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.spec'
--- test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.spec 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.spec 2013-07-17 15:56:30 +0000
@@ -1,1 +1,1 @@
1Error: http://www.zorba-xquery.com/modules/math:Num1Error: http://zorba.io/modules/math:INVALID_ARGUMENT
22
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:gcd((-5, 0, 2))4math:gcd((-5, 0, 2))
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:gcd((3))4math:gcd((3))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:gcd((6, 12, 15))4math:gcd((6, 12, 15))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_int1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_int1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_int1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:int(8.9)4math:int(8.9)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_int2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_int2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_int2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:int(-8.9)4math:int(-8.9)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:int(19.5)4math:int(19.5)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:int(-4.3)4math:int(-4.3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:large((), 1)4math:large((), 1)
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:large((3, 4, 5, 2, 3, 4, 5, 6, 4, 7), 3)4math:large((3, 4, 5, 2, 3, 4, 5, 6, 4, 7), 3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:large((3, 4, 5, 2, 3, 4, 5, 6, 4, 7), 7 )4math:large((3, 4, 5, 2, 3, 4, 5, 6, 4, 7), 7 )
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:lcm((5,2))4math:lcm((5,2))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:lcm((24, 36))4math:lcm((24, 36))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:lcm((5,0))4math:lcm((5,0))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:lcm((2, 4, 8))4math:lcm((2, 4, 8))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:lcm((11, 12, 13))4math:lcm((11, 12, 13))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:median((1, 3, 4, 2, 5))4math:median((1, 3, 4, 2, 5))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:median((1, 3, 4, 2))4math:median((1, 3, 4, 2))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:mod(3,2)4math:mod(3,2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:mod(-3,2)4math:mod(-3,2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:mod(3,-2)4math:mod(3,-2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:mod(-3,-2)4math:mod(-3,-2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mode1.spec'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mode1.spec 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mode1.spec 2013-07-17 15:56:30 +0000
@@ -1,1 +1,1 @@
1Error: http://www.zorba-xquery.com/modules/math:NA1Error: http://zorba.io/modules/math:INVALID_INPUT
22
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:mode((1, 3, 4, 2, 5))4math:mode((1, 3, 4, 2, 5))
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:mode((1, 3, 4, 2, "l"))4math:mode((1, 3, 4, 2, "l"))
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:mode((1, 3, 4, 3, 2, 2, 5, 3, 5))4math:mode((1, 3, 4, 3, 2, 2, 5, 3, 5))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mround1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mround1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mround1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:mround(10, 3)4math:mround(10, 3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mround2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mround2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mround2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:mround(-10, -3)4math:mround(-10, -3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2zorba-math="http://www.zorba-xquery.com/modules/math";2zorba-math="http://zorba.io/modules/math";
33
4zorba-math:mround(1.3, 0.2)4zorba-math:mround(1.3, 0.2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mround4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_mround4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_mround4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2zorba-math="http://www.zorba-xquery.com/modules/math";2zorba-math="http://zorba.io/modules/math";
33
4zorba-math:mround(-1.3, -0.2)4zorba-math:mround(-1.3, -0.2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_odd1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_odd1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:odd(1.5)4math:odd(1.5)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_odd2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_odd2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:odd(3)4math:odd(3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_odd3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_odd3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:odd(2)4math:odd(2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_odd4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_odd4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:odd(-1)4math:odd(-1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:odd(-2)4math:odd(-2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:odd(0)4math:odd(0)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 1)4math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 0.5)4math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 0.5)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.spec'
--- test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.spec 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.spec 2013-07-17 15:56:30 +0000
@@ -1,1 +1,1 @@
1Error: http://www.zorba-xquery.com/modules/math:Num1Error: http://zorba.io/modules/math:INVALID_ARGUMENT
22
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 5)4math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 5)
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 2)4math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 4)4math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 4)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 8)4math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 8)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 5)4math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 5)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.spec'
--- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.spec 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.spec 2013-07-17 15:56:30 +0000
@@ -1,1 +1,1 @@
1Error: http://www.zorba-xquery.com/modules/math:Num1Error: http://zorba.io/modules/math:INVALID_ARGUMENT
22
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:percentrank((), 2)4math:percentrank((), 2)
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:prob((0, 1, 2, 3), (0.2, 0.3, 0.1, 0.4), 2)4math:prob((0, 1, 2, 3), (0.2, 0.3, 0.1, 0.4), 2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:prob((0, 1, 2, 3), (0.2, 0.3, 0.1, 0.4), 1, 3)4math:prob((0, 1, 2, 3), (0.2, 0.3, 0.1, 0.4), 1, 3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_product1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_product1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_product1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:product((2, 0.5))4math:product((2, 0.5))
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_product2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_product2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_product2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:product((5, 15, 30, 0))4math:product((5, 15, 30, 0))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_product3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_product3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_product3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:product((5, 15, 30, -1))4math:product((5, 15, 30, -1))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:product((5, 15, 30, "POP"))4math:product((5, 15, 30, "POP"))
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:product(())4math:product(())
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 0)4math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 0)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 1)4math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 2)4math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 3)4math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 4)4math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 4)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:quotient(5,2)4math:quotient(5,2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:quotient(4.5, 3.1)4math:quotient(4.5, 3.1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:quotient(-10,3)4math:quotient(-10,3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.spec'
--- test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.spec 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.spec 2013-07-17 15:56:30 +0000
@@ -1,1 +1,1 @@
1Error: http://www.zorba-xquery.com/modules/math:Div01Error: http://zorba.io/modules/math:DIVIDE_BY_0
22
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:quotient(1,0)4math:quotient(1,0)
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rank1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_rank1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_rank1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:rank(3.5, (7, 3.5, 3.5, 1, 2), fn:true() )4math:rank(3.5, (7, 3.5, 3.5, 1, 2), fn:true() )
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rank2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_rank2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_rank2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:rank(7, (7, 3.5, 3.5, 1, 2), fn:true() )4math:rank(7, (7, 3.5, 3.5, 1, 2), fn:true() )
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rank3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_rank3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_rank3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:rank(3.5, (7, 3.5, 3.5, 1, 2) )4math:rank(3.5, (7, 3.5, 3.5, 1, 2) )
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:rank(3.5, (2, 3, 4), fn:true() )4math:rank(3.5, (2, 3, 4), fn:true() )
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:rank(3.5, (1, 2) )4math:rank(3.5, (1, 2) )
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:roman(499)4math:roman(499)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:roman(2009)4math:roman(2009)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:roman(1555)4math:roman(1555)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_round1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_round1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_round1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:round(2.15, 1)4math:round(2.15, 1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_round2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_round2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_round2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:round(2.149, 1)4math:round(2.149, 1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_round3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_round3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_round3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:round(-1.475, 2)4math:round(-1.475, 2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:round(21.5, -1)4math:round(21.5, -1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rounddown1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_rounddown1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_rounddown1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:rounddown(3.2, 0)4math:rounddown(3.2, 0)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rounddown2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_rounddown2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_rounddown2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:rounddown(76.9,0)4math:rounddown(76.9,0)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rounddown3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_rounddown3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_rounddown3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:rounddown(3.14159, 3)4math:rounddown(3.14159, 3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rounddown4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_rounddown4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_rounddown4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:rounddown(-3.14159, 1)4math:rounddown(-3.14159, 1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:rounddown(31415.92654, -2)4math:rounddown(31415.92654, -2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roundup1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_roundup1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_roundup1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:roundup(3.2, 0)4math:roundup(3.2, 0)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roundup2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_roundup2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_roundup2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:roundup(76.9,0)4math:roundup(76.9,0)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roundup3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_roundup3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_roundup3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:roundup(3.14159, 3)4math:roundup(3.14159, 3)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roundup4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_roundup4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_roundup4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:roundup(-3.14159, 1)4math:roundup(-3.14159, 1)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:roundup(31415.92654, -2)4math:roundup(31415.92654, -2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_sign1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_sign1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_sign1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:sign(100)4math:sign(100)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:sign(0)4math:sign(0)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:sign(-1E100)4math:sign(-1E100)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:slope((2, 3, 9, 1, 8, 7, 5), (6, 5, 11, 7, 5, 4, 4))4math:slope((2, 3, 9, 1, 8, 7, 5), (6, 5, 11, 7, 5, 4, 4))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:small((3, 4, 5, 2, 3, 4, 6, 4, 7), 4)4math:small((3, 4, 5, 2, 3, 4, 6, 4, 7), 4)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:small((1, 4, 8, 3, 7, 12, 54, 8, 23), 2)4math:small((1, 4, 8, 3, 7, 12, 54, 8, 23), 2)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:standardize(42, 40, 1.5)4math:standardize(42, 40, 1.5)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:stdev((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:stdev((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:stdeva((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:stdeva((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:stdevp((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:stdevp((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:stdevpa((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:stdevpa((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(1, (2, 3, 4))4math:subtotal(1, (2, 3, 4))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(10, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:subtotal(10, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(11, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:subtotal(11, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(2, (2, 3, 4))4math:subtotal(2, (2, 3, 4))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(3, (2, 3, 4, "", "x"))4math:subtotal(3, (2, 3, 4, "", "x"))
55
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal4.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(4, (2, 3, 4))4math:subtotal(4, (2, 3, 4))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal5.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal5.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal5.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(5, (2, 3, 4))4math:subtotal(5, (2, 3, 4))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal6.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal6.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal6.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(6, (2, 3, 4))4math:subtotal(6, (2, 3, 4))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal7.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal7.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal7.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(7, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:subtotal(7, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal8.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal8.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal8.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(8, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:subtotal(8, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal9.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal9.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal9.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:subtotal(9, (2, 3, 4))4math:subtotal(9, (2, 3, 4))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:sumproduct((1,2,3,4,5),4math:sumproduct((1,2,3,4,5),
5 (1,2,3,4,5))5 (1,2,3,4,5))
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:sumsq((1,2,3,4,5))4math:sumsq((1,2,3,4,5))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:trunc(8.9)4math:trunc(8.9)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:trunc(-8.9)4math:trunc(-8.9)
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq 2013-07-17 15:56:30 +0000
@@ -1,5 +1,5 @@
1declare namespace math="http://www.w3.org/2005/xpath-functions/math";1declare namespace math="http://www.w3.org/2005/xpath-functions/math";
2import module namespace2import module namespace
3zorba-math="http://www.zorba-xquery.com/modules/math";3zorba-math="http://zorba.io/modules/math";
44
5zorba-math:trunc(math:pi(), 2)5zorba-math:trunc(math:pi(), 2)
66
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:var((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:var((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:vara((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:vara((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:varp((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:varp((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq'
--- test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace1import module namespace
2math="http://www.zorba-xquery.com/modules/math";2math="http://zorba.io/modules/math";
33
4math:varpa((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))4math:varpa((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299))
55
=== modified file 'test/rbkt/Queries/zorba/math/is_inf1.xq'
--- test/rbkt/Queries/zorba/math/is_inf1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/is_inf1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1declare namespace math="http://www.w3.org/2005/xpath-functions/math";1declare namespace math="http://www.w3.org/2005/xpath-functions/math";
2import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";2import module namespace fn-zorba-math = "http://zorba.io/modules/math";
33
4fn-zorba-math:is_inf(math:pow(0, -1))4fn-zorba-math:is_inf(math:pow(0, -1))
55
=== modified file 'test/rbkt/Queries/zorba/math/is_nan1.xq'
--- test/rbkt/Queries/zorba/math/is_nan1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/is_nan1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:is_nan(xs:double("NaN"))3fn-zorba-math:is_nan(xs:double("NaN"))
44
=== modified file 'test/rbkt/Queries/zorba/math/ldexp1.xq'
--- test/rbkt/Queries/zorba/math/ldexp1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/ldexp1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:ldexp(4, 3)3fn-zorba-math:ldexp(4, 3)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/math/modf1.xq'
--- test/rbkt/Queries/zorba/math/modf1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/modf1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:modf(-14.876543)3fn-zorba-math:modf(-14.876543)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/math/sinh1.xq'
--- test/rbkt/Queries/zorba/math/sinh1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/sinh1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1declare namespace math="http://www.w3.org/2005/xpath-functions/math";1declare namespace math="http://www.w3.org/2005/xpath-functions/math";
2import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";2import module namespace fn-zorba-math = "http://zorba.io/modules/math";
33
4fn-zorba-math:sinh(math:pi() div 2)4fn-zorba-math:sinh(math:pi() div 2)
5\ No newline at end of file5\ No newline at end of file
66
=== modified file 'test/rbkt/Queries/zorba/math/tanh1.xq'
--- test/rbkt/Queries/zorba/math/tanh1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/math/tanh1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math";1import module namespace fn-zorba-math = "http://zorba.io/modules/math";
22
3fn-zorba-math:tanh(1)3fn-zorba-math:tanh(1)
4\ No newline at end of file4\ No newline at end of file
55
=== modified file 'test/rbkt/Queries/zorba/random/random1.xq'
--- test/rbkt/Queries/zorba/random/random1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/random/random1.xq 2013-07-17 15:56:30 +0000
@@ -1,3 +1,3 @@
1import module namespace r = "http://www.zorba-xquery.com/modules/random";1import module namespace r = "http://zorba.io/modules/random";
22
3count((for $i in 1 to 10 return r:random(10), r:random())) eq 1013count((for $i in 1 to 10 return r:random(10), r:random())) eq 101
44
=== modified file 'test/rbkt/Queries/zorba/random/seeded-random-between1.xq'
--- test/rbkt/Queries/zorba/random/seeded-random-between1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/random/seeded-random-between1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace r = "http://www.zorba-xquery.com/modules/random";1import module namespace r = "http://zorba.io/modules/random";
22
3declare namespace err = "http://www.w3.org/2005/xqt-errors";3declare namespace err = "http://www.w3.org/2005/xqt-errors";
44
@@ -10,7 +10,7 @@
10try10try
11{11{
12 r:seeded-random-between(1, 4, 1, 100)12 r:seeded-random-between(1, 4, 1, 100)
13} catch r:invalid-arg13} catch r:INVALID_ARGUMENT
14{14{
15 $err:description, $err:value15 $err:description, $err:value
16}16}
1717
=== modified file 'test/rbkt/Queries/zorba/random/seeded-random1.xq'
--- test/rbkt/Queries/zorba/random/seeded-random1.xq 2013-06-25 03:55:20 +0000
+++ test/rbkt/Queries/zorba/random/seeded-random1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace r = "http://www.zorba-xquery.com/modules/random";1import module namespace r = "http://zorba.io/modules/random";
22
3declare namespace zerr = "http://zorba.io/modules/zorba-errors";3declare namespace zerr = "http://zorba.io/modules/zorba-errors";
4declare namespace err = "http://www.w3.org/2005/xqt-errors";4declare namespace err = "http://www.w3.org/2005/xqt-errors";
55
=== modified file 'test/rbkt/Queries/zorba/random/uuid1.xq'
--- test/rbkt/Queries/zorba/random/uuid1.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/random/uuid1.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace r = "http://www.zorba-xquery.com/modules/random";1import module namespace r = "http://zorba.io/modules/random";
22
3(: all uuids are distinct? :)3(: all uuids are distinct? :)
4let $seq := for $i in 1 to 10 return r:uuid()4let $seq := for $i in 1 to 10 return r:uuid()
55
=== modified file 'test/rbkt/Queries/zorba/random/uuid2.xq'
--- test/rbkt/Queries/zorba/random/uuid2.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/random/uuid2.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace r = "http://www.zorba-xquery.com/modules/random";1import module namespace r = "http://zorba.io/modules/random";
22
3(: all uuids are distinct? :)3(: all uuids are distinct? :)
4let $seq := for $i in 1 to 10 return r:uuid()4let $seq := for $i in 1 to 10 return r:uuid()
55
=== modified file 'test/rbkt/Queries/zorba/reflection/reflection-invoke-10.xq'
--- test/rbkt/Queries/zorba/reflection/reflection-invoke-10.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/reflection/reflection-invoke-10.xq 2013-07-17 15:56:30 +0000
@@ -1,6 +1,6 @@
1import module namespace ref = "http://www.zorba-xquery.com/modules/reflection";1import module namespace ref = "http://www.zorba-xquery.com/modules/reflection";
2import module namespace rand = "http://www.zorba-xquery.com/modules/random";2import module namespace rand = "http://zorba.io/modules/random";
33
4declare variable $name as xs:QName := fn:QName('http://www.zorba-xquery.com/modules/random', 'random');4declare variable $name as xs:QName := fn:QName('http://zorba.io/modules/random', 'random');
55
6count( ref:invoke($name) ) > 06count( ref:invoke($name) ) > 0
77
=== modified file 'test/rbkt/Queries/zorba/scripting/constr4.xq'
--- test/rbkt/Queries/zorba/scripting/constr4.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/scripting/constr4.xq 2013-07-17 15:56:30 +0000
@@ -1,4 +1,4 @@
1import module namespace r = "http://www.zorba-xquery.com/modules/random";1import module namespace r = "http://zorba.io/modules/random";
22
3(: test call to a nondeterministic function in an element constructor :)3(: test call to a nondeterministic function in an element constructor :)
4element book {4element book {
55
=== modified file 'test/rbkt/Queries/zorba/string/AnalyzeString/http-client-doc.htm'
--- test/rbkt/Queries/zorba/string/AnalyzeString/http-client-doc.htm 2013-07-17 07:20:31 +0000
+++ test/rbkt/Queries/zorba/string/AnalyzeString/http-client-doc.htm 2013-07-17 15:56:30 +0000
@@ -126,7 +126,7 @@
126 </sup>126 </sup>
127 </li>127 </li>
128 <li>128 <li>
129 <a href="www.zorba-xquery.com_modules_math.html" title="http://www.zorba-xquery.com/modules/math">math</a>129 <a href="www.zorba-xquery.com_modules_math.html" title="http://zorba.io/modules/math">math</a>
130 <sup>130 <sup>
131 <a href="http://www.w3.org/TR/xquery-30/#dt-external-function" target="_blank" title="There are external functions (either private or public) declared in this module.">(E)</a>131 <a href="http://www.w3.org/TR/xquery-30/#dt-external-function" target="_blank" title="There are external functions (either private or public) declared in this module.">(E)</a>
132 </sup>132 </sup>
@@ -135,7 +135,7 @@
135 </sup>135 </sup>
136 </li>136 </li>
137 <li>137 <li>
138 <a href="www.zorba-xquery.com_modules_random.html" title="http://www.zorba-xquery.com/modules/random">random</a>138 <a href="www.zorba-xquery.com_modules_random.html" title="http://zorba.io/modules/random">random</a>
139 <sup>139 <sup>
140 <a href="http://www.w3.org/TR/xquery-30/#dt-external-function" target="_blank" title="There are external functions (either private or public) declared in this module.">(E)</a>140 <a href="http://www.w3.org/TR/xquery-30/#dt-external-function" target="_blank" title="There are external functions (either private or public) declared in this module.">(E)</a>
141 </sup>141 </sup>
142142
=== modified file 'test/rbkt/Queries/zorba/xqxq/external-module.xq'
--- test/rbkt/Queries/zorba/xqxq/external-module.xq 2012-10-25 00:07:03 +0000
+++ test/rbkt/Queries/zorba/xqxq/external-module.xq 2013-07-17 15:56:30 +0000
@@ -1,7 +1,7 @@
1import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq';1import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq';
22
3variable $query-key := xqxq:prepare-main-module('3variable $query-key := xqxq:prepare-main-module('
4 import module namespace r = "http://www.zorba-xquery.com/modules/random";4 import module namespace r = "http://zorba.io/modules/random";
55
6 count((for $i in 1 to 10 return r:random(10), r:random())) eq 1016 count((for $i in 1 to 10 return r:random(10), r:random())) eq 101
7 ');7 ');
88
=== modified file 'test/unit/invoke.cpp'
--- test/unit/invoke.cpp 2013-02-07 17:24:36 +0000
+++ test/unit/invoke.cpp 2013-07-17 15:56:30 +0000
@@ -164,12 +164,12 @@
164164
165 std::ostringstream lProlog;165 std::ostringstream lProlog;
166 lProlog166 lProlog
167 << "import module namespace r = 'http://www.zorba-xquery.com/modules/random';";167 << "import module namespace r = 'http://zorba.io/modules/random';";
168 lSctx->loadProlog(lProlog.str(), lHints);168 lSctx->loadProlog(lProlog.str(), lHints);
169169
170 ItemFactory* lFac = z->getItemFactory();170 ItemFactory* lFac = z->getItemFactory();
171 Item lQName = lFac->createQName(171 Item lQName = lFac->createQName(
172 "http://www.zorba-xquery.com/modules/random",172 "http://zorba.io/modules/random",
173 "random"); 173 "random");
174174
175 std::vector<ItemSequence_t> lArgs;175 std::vector<ItemSequence_t> lArgs;

Subscribers

People subscribed via source and target branches