Merge lp:~zorba-coders/zorba/bug-1189794-core into lp:zorba
- bug-1189794-core
- Merge into trunk
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 | ||||||||
Related bugs: |
|
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.
Description of the change
Chris Hillery (ceejatec) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
- 11559. By Chris Hillery
-
More JSONifying - remove xs:, bareword true/false, etc.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting criteria failed for the following merge proposals:
https:/
Votes: {'Approve': 1}
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "CommitZorba" failed.
Check console output at http://
- 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/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "TestZorbaUbuntu" failed.
14 tests failed (8355 total tests run).
Check test results at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting criteria failed for the following merge proposals:
https:/
Votes: {'Approve': 1}
https:/
Votes: {'Approve': 1}
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "CommitZorba" failed.
Check console output at http://
- 11564. By Chris Hillery
-
Merge from trunk.
- 11565. By Chris Hillery
-
Move base64 module into atomic/ directory.
Luis Rodriguez Gonzalez (kuraru) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue succeeded - proposal merged!
Preview Diff
1 | === modified file 'modules/CMakeLists.txt' | |||
2 | --- modules/CMakeLists.txt 2013-07-17 07:20:31 +0000 | |||
3 | +++ modules/CMakeLists.txt 2013-07-17 15:56:30 +0000 | |||
4 | @@ -12,6 +12,7 @@ | |||
5 | 12 | # See the License for the specific language governing permissions and | 12 | # See the License for the specific language governing permissions and |
6 | 13 | # limitations under the License. | 13 | # limitations under the License. |
7 | 14 | 14 | ||
8 | 15 | ADD_SUBDIRECTORY(atomic) | ||
9 | 15 | ADD_SUBDIRECTORY(com) | 16 | ADD_SUBDIRECTORY(com) |
10 | 16 | ADD_SUBDIRECTORY(org) | 17 | ADD_SUBDIRECTORY(org) |
11 | 17 | ADD_SUBDIRECTORY(functx) | 18 | ADD_SUBDIRECTORY(functx) |
12 | @@ -20,7 +21,6 @@ | |||
13 | 20 | ADD_SUBDIRECTORY(full-text) | 21 | ADD_SUBDIRECTORY(full-text) |
14 | 21 | ADD_SUBDIRECTORY(json) | 22 | ADD_SUBDIRECTORY(json) |
15 | 22 | ADD_SUBDIRECTORY(nodes) | 23 | ADD_SUBDIRECTORY(nodes) |
16 | 23 | ADD_SUBDIRECTORY(base64) | ||
17 | 24 | 24 | ||
18 | 25 | # Add external module projects - any subdirectories of a directory | 25 | # Add external module projects - any subdirectories of a directory |
19 | 26 | # named "zorba_modules" as a sibling to the main Zorba source | 26 | # named "zorba_modules" as a sibling to the main Zorba source |
20 | 27 | 27 | ||
21 | === added directory 'modules/atomic' | |||
22 | === added file 'modules/atomic/CMakeLists.txt' | |||
23 | --- modules/atomic/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
24 | +++ modules/atomic/CMakeLists.txt 2013-07-17 15:56:30 +0000 | |||
25 | @@ -0,0 +1,20 @@ | |||
26 | 1 | # Copyright 2013 The FLWOR Foundation. | ||
27 | 2 | # | ||
28 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
29 | 4 | # you may not use this file except in compliance with the License. | ||
30 | 5 | # You may obtain a copy of the License at | ||
31 | 6 | # | ||
32 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
33 | 8 | # | ||
34 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
35 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
36 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
37 | 12 | # See the License for the specific language governing permissions and | ||
38 | 13 | # limitations under the License. | ||
39 | 14 | |||
40 | 15 | DECLARE_ZORBA_MODULE(FILE math.xq VERSION 1.0 | ||
41 | 16 | URI "http://zorba.io/modules/math") | ||
42 | 17 | DECLARE_ZORBA_MODULE(FILE random.xq VERSION 1.0 | ||
43 | 18 | URI "http://zorba.io/modules/random") | ||
44 | 19 | DECLARE_ZORBA_MODULE(FILE base64.xq VERSION 1.0 | ||
45 | 20 | URI "http://zorba.io/modules/base64") | ||
46 | 0 | 21 | ||
47 | === renamed file 'modules/base64/base64.xq' => 'modules/atomic/base64.xq' | |||
48 | === renamed file 'modules/com/zorba-xquery/www/modules/math.xq' => 'modules/atomic/math.xq' | |||
49 | --- modules/com/zorba-xquery/www/modules/math.xq 2013-06-15 16:20:18 +0000 | |||
50 | +++ modules/atomic/math.xq 2013-07-17 15:56:30 +0000 | |||
51 | @@ -1,4 +1,4 @@ | |||
53 | 1 | xquery version "3.0"; | 1 | jsoniq version "1.0"; |
54 | 2 | 2 | ||
55 | 3 | (: | 3 | (: |
56 | 4 | : Copyright 2006-2009 The FLWOR Foundation. | 4 | : Copyright 2006-2009 The FLWOR Foundation. |
57 | @@ -17,12 +17,12 @@ | |||
58 | 17 | :) | 17 | :) |
59 | 18 | 18 | ||
60 | 19 | (:~ | 19 | (:~ |
62 | 20 | : Extensive math library. | 20 | : Extensive math library.<p/> |
63 | 21 | : | 21 | : |
64 | 22 | : @author Daniel Turcanu, Dan Muresan | 22 | : @author Daniel Turcanu, Dan Muresan |
65 | 23 | : @project Zorba/XQuery Data Model/Atomic/Math | 23 | : @project Zorba/XQuery Data Model/Atomic/Math |
66 | 24 | :) | 24 | :) |
68 | 25 | module namespace math = "http://www.zorba-xquery.com/modules/math"; | 25 | module namespace math = "http://zorba.io/modules/math"; |
69 | 26 | 26 | ||
70 | 27 | (:~ | 27 | (:~ |
71 | 28 | : W3C Math namespace URI. | 28 | : W3C Math namespace URI. |
72 | @@ -30,42 +30,23 @@ | |||
73 | 30 | declare namespace W3Cmath = "http://www.w3.org/2005/xpath-functions/math"; | 30 | declare namespace W3Cmath = "http://www.w3.org/2005/xpath-functions/math"; |
74 | 31 | 31 | ||
75 | 32 | declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; | 32 | declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; |
106 | 33 | declare option ver:module-version "2.0"; | 33 | declare option ver:module-version "1.0"; |
107 | 34 | 34 | ||
108 | 35 | (:~ | 35 | declare %private variable $math:errNS as string := "http://zorba.io/modules/math"; |
109 | 36 | : Errors namespace URI. | 36 | declare %private variable $math:VALUE_NOT_NUMERIC as QName := fn:QName($math:errNS, "math:VALUE_NOT_NUMERIC"); |
110 | 37 | :) | 37 | declare %private variable $math:INVALID_ARGUMENT as QName := fn:QName($math:errNS, "math:INVALID_ARGUMENT"); |
111 | 38 | declare variable $math:errNS as xs:string := "http://www.zorba-xquery.com/modules/math"; | 38 | declare %private variable $math:DIVIDE_BY_0 as QName := fn:QName($math:errNS, "math:DIVIDE_BY_0"); |
112 | 39 | 39 | declare %private variable $math:INVALID_INPUT as QName := fn:QName($math:errNS, "math:INVALID_INPUT"); | |
113 | 40 | (:~ | 40 | |
114 | 41 | : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/math" and local name "math:Value" | 41 | |
115 | 42 | :) | 42 | (:~ |
116 | 43 | declare variable $math:errValue as xs:QName := fn:QName($math:errNS, "math:Value"); | 43 | : Returns the hyperbolic cosine of x.<p/> |
87 | 44 | |||
88 | 45 | (:~ | ||
89 | 46 | : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/math" and local name "math:Num" | ||
90 | 47 | :) | ||
91 | 48 | declare variable $math:errNum as xs:QName := fn:QName($math:errNS, "math:Num"); | ||
92 | 49 | |||
93 | 50 | (:~ | ||
94 | 51 | : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/math" and local name "math:Div0" | ||
95 | 52 | :) | ||
96 | 53 | declare variable $math:errDiv0 as xs:QName := fn:QName($math:errNS, "math:Div0"); | ||
97 | 54 | |||
98 | 55 | (:~ | ||
99 | 56 | : xs:QName with namespace URI="http://www.zorba-xquery.com/modules/math" and local name "math:NA" | ||
100 | 57 | :) | ||
101 | 58 | declare variable $math:errNA as xs:QName := fn:QName($math:errNS, "math:NA"); | ||
102 | 59 | |||
103 | 60 | |||
104 | 61 | (:~ | ||
105 | 62 | : Returns the hyperbolic cosine of x. | ||
117 | 63 | : If the result it too large, INF is returned. | 44 | : If the result it too large, INF is returned. |
118 | 64 | : | 45 | : |
119 | 65 | : @param $arg must be smaller than 7.104760e+002 | 46 | : @param $arg must be smaller than 7.104760e+002 |
120 | 66 | : @return cosh(arg) | 47 | : @return cosh(arg) |
121 | 67 | :) | 48 | :) |
123 | 68 | declare function math:cosh ($arg as xs:double) as xs:double external; | 49 | declare function math:cosh ($arg as double) as double external; |
124 | 69 | 50 | ||
125 | 70 | (:~ | 51 | (:~ |
126 | 71 | : Inverse hyperbolic cosine. | 52 | : Inverse hyperbolic cosine. |
127 | @@ -73,7 +54,7 @@ | |||
128 | 73 | : @param $arg the arg | 54 | : @param $arg the arg |
129 | 74 | : @return the result of acosh(arg) | 55 | : @return the result of acosh(arg) |
130 | 75 | :) | 56 | :) |
132 | 76 | declare function math:acosh ($arg as xs:double) as xs:double external; | 57 | declare function math:acosh ($arg as double) as double external; |
133 | 77 | 58 | ||
134 | 78 | (:~ | 59 | (:~ |
135 | 79 | : Function performing the modulo operation between the two arguments. | 60 | : Function performing the modulo operation between the two arguments. |
136 | @@ -82,51 +63,51 @@ | |||
137 | 82 | : @param $y the y | 63 | : @param $y the y |
138 | 83 | : @return The remainder of x/y. | 64 | : @return The remainder of x/y. |
139 | 84 | :) | 65 | :) |
141 | 85 | declare function math:fmod ($x as xs:double, $y as xs:double) as xs:double external; | 66 | declare function math:fmod ($x as double, $y as double) as double external; |
142 | 86 | 67 | ||
143 | 87 | (:~ | 68 | (:~ |
145 | 88 | : Returns the argument split as mantissa and exponent. | 69 | : Returns the argument split as mantissa and exponent.<p/> |
146 | 89 | : The recombining formula is (mantissa * 2^exponent). | 70 | : The recombining formula is (mantissa * 2^exponent). |
147 | 90 | : | 71 | : |
148 | 91 | : @param $arg the double to be split. | 72 | : @param $arg the double to be split. |
149 | 92 | : @return A sequence of two doubles (mantissa, exponent) | 73 | : @return A sequence of two doubles (mantissa, exponent) |
150 | 93 | :) | 74 | :) |
152 | 94 | declare function math:frexp ($arg as xs:double) as xs:double+ external; | 75 | declare function math:frexp ($arg as double) as double+ external; |
153 | 95 | 76 | ||
154 | 96 | (:~ | 77 | (:~ |
156 | 97 | : Computes a real number from the mantissa and exponent. | 78 | : Computes a real number from the mantissa and exponent.<p/> |
157 | 98 | : The formula is (x * 2^i). | 79 | : The formula is (x * 2^i). |
158 | 99 | : | 80 | : |
159 | 100 | : @param $x the mantissa | 81 | : @param $x the mantissa |
160 | 101 | : @param $i the exponent | 82 | : @param $i the exponent |
161 | 102 | : @return the computed real number | 83 | : @return the computed real number |
162 | 103 | :) | 84 | :) |
164 | 104 | declare function math:ldexp ($x as xs:double, $i as xs:integer) as xs:double external; | 85 | declare function math:ldexp ($x as double, $i as integer) as double external; |
165 | 105 | 86 | ||
166 | 106 | (:~ | 87 | (:~ |
168 | 107 | : Splits a floating-point value into fractional and integer parts. | 88 | : Splits a floating-point value into fractional and integer parts.<p/> |
169 | 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. |
170 | 109 | : | 90 | : |
171 | 110 | : @param $arg the double to be split. | 91 | : @param $arg the double to be split. |
172 | 111 | : @return A sequence of two doubles (fraction, integer) | 92 | : @return A sequence of two doubles (fraction, integer) |
173 | 112 | :) | 93 | :) |
175 | 113 | declare function math:modf ($arg as xs:double) as xs:double+ external; | 94 | declare function math:modf ($arg as double) as double+ external; |
176 | 114 | 95 | ||
177 | 115 | (:~ | 96 | (:~ |
179 | 116 | : Calculate hyperbolic sine. | 97 | : Calculate the hyperbolic sine. |
180 | 117 | : | 98 | : |
181 | 118 | : @param $arg the arg | 99 | : @param $arg the arg |
182 | 119 | : @return the result of sinh(arg) | 100 | : @return the result of sinh(arg) |
183 | 120 | :) | 101 | :) |
185 | 121 | declare function math:sinh ($arg as xs:double) as xs:double external; | 102 | declare function math:sinh ($arg as double) as double external; |
186 | 122 | 103 | ||
187 | 123 | (:~ | 104 | (:~ |
189 | 124 | : Inverse hyperbolic sine of the number. | 105 | : Calculate the inverse hyperbolic sine. |
190 | 125 | : | 106 | : |
191 | 126 | : @param $arg the arg | 107 | : @param $arg the arg |
192 | 127 | : @return the result of asinh(arg) | 108 | : @return the result of asinh(arg) |
193 | 128 | :) | 109 | :) |
195 | 129 | declare function math:asinh($arg as xs:double) as xs:double external; | 110 | declare function math:asinh($arg as double) as double external; |
196 | 130 | 111 | ||
197 | 131 | (:~ | 112 | (:~ |
198 | 132 | : Calculate the hyperbolic tangent. | 113 | : Calculate the hyperbolic tangent. |
199 | @@ -134,7 +115,7 @@ | |||
200 | 134 | : @param $arg the arg | 115 | : @param $arg the arg |
201 | 135 | : @return the result of tanh(arg) | 116 | : @return the result of tanh(arg) |
202 | 136 | :) | 117 | :) |
204 | 137 | declare function math:tanh($arg as xs:double) as xs:double external; | 118 | declare function math:tanh($arg as double) as double external; |
205 | 138 | 119 | ||
206 | 139 | (:~ | 120 | (:~ |
207 | 140 | : Calculate the hyperbolic tangent. | 121 | : Calculate the hyperbolic tangent. |
208 | @@ -142,27 +123,27 @@ | |||
209 | 142 | : @param $arg must be in range -1 ... +1 (exclusive) | 123 | : @param $arg must be in range -1 ... +1 (exclusive) |
210 | 143 | : @return the result of atanh(arg) | 124 | : @return the result of atanh(arg) |
211 | 144 | :) | 125 | :) |
213 | 145 | declare function math:atanh($arg as xs:double) as xs:double external; | 126 | declare function math:atanh($arg as double) as double external; |
214 | 146 | 127 | ||
215 | 147 | (:~ | 128 | (:~ |
217 | 148 | : Convert angle from degrees to radians. <br/> | 129 | : Convert angle from degrees to radians. <p/> |
218 | 149 | : The parameter is first converted to value range of (-360, 360). | 130 | : The parameter is first converted to value range of (-360, 360). |
219 | 150 | : | 131 | : |
220 | 151 | : @param $deg angle in degrees | 132 | : @param $deg angle in degrees |
221 | 152 | : @return value in radians (-2PI, 2PI) | 133 | : @return value in radians (-2PI, 2PI) |
222 | 153 | :) | 134 | :) |
224 | 154 | declare function math:deg-to-rad($deg as xs:double) as xs:double | 135 | declare function math:deg-to-rad($deg as double) as double |
225 | 155 | { | 136 | { |
226 | 156 | ($deg mod 360) * 2 * W3Cmath:pi() div 360 | 137 | ($deg mod 360) * 2 * W3Cmath:pi() div 360 |
227 | 157 | }; | 138 | }; |
228 | 158 | 139 | ||
229 | 159 | (:~ | 140 | (:~ |
231 | 160 | : Convert angle from radians to degrees. <br/> | 141 | : Convert angle from radians to degrees. <p/> |
232 | 161 | : | 142 | : |
233 | 162 | : @param $rad value in radians | 143 | : @param $rad value in radians |
234 | 163 | : @return value in degrees (-360, 360) | 144 | : @return value in degrees (-360, 360) |
235 | 164 | :) | 145 | :) |
237 | 165 | declare function math:rad-to-deg($rad as xs:double) as xs:double | 146 | declare function math:rad-to-deg($rad as double) as double |
238 | 166 | { | 147 | { |
239 | 167 | ($rad * 360 div 2 div W3Cmath:pi()) mod 360 | 148 | ($rad * 360 div 2 div W3Cmath:pi()) mod 360 |
240 | 168 | }; | 149 | }; |
241 | @@ -173,7 +154,7 @@ | |||
242 | 173 | : @param $arg the double to be checked | 154 | : @param $arg the double to be checked |
243 | 174 | : @return boolean true if argument is pos INF or neg INF | 155 | : @return boolean true if argument is pos INF or neg INF |
244 | 175 | :) | 156 | :) |
246 | 176 | declare function math:is_inf($arg as xs:double) as xs:boolean external; | 157 | declare function math:is_inf($arg as double) as boolean external; |
247 | 177 | 158 | ||
248 | 178 | (:~ | 159 | (:~ |
249 | 179 | : Checks if the double value is Not a Number (NaN). | 160 | : Checks if the double value is Not a Number (NaN). |
250 | @@ -181,7 +162,7 @@ | |||
251 | 181 | : @param $arg the arg | 162 | : @param $arg the arg |
252 | 182 | : @return boolean true if the double is NaN | 163 | : @return boolean true if the double is NaN |
253 | 183 | :) | 164 | :) |
255 | 184 | declare function math:is_nan($arg as xs:double) as xs:boolean external; | 165 | declare function math:is_nan($arg as double) as boolean external; |
256 | 185 | 166 | ||
257 | 186 | 167 | ||
258 | 187 | 168 | ||
259 | @@ -189,58 +170,59 @@ | |||
260 | 189 | (:Excel math functions:) | 170 | (:Excel math functions:) |
261 | 190 | 171 | ||
262 | 191 | (:~ | 172 | (:~ |
266 | 192 | : Borrowed from excel module.<br/> | 173 | : Checks if the anyAtomicType argument is actually a numeric type |
267 | 193 | : Checks if the xs:anyAtomicType argument is actually a numeric type | 174 | : or can be converted to numeric.<p/> |
268 | 194 | : or can be converted to numeric. | 175 | : Borrowed from excel module. |
269 | 195 | : | 176 | : |
270 | 196 | : @param $value Parameter to be checked. | 177 | : @param $value Parameter to be checked. |
271 | 197 | : @return true if the value can be casted to numeric. | 178 | : @return true if the value can be casted to numeric. |
272 | 198 | :) | 179 | :) |
274 | 199 | declare function math:is-a-number($value as xs:anyAtomicType) as xs:boolean | 180 | declare function math:is-a-number($value as anyAtomicType) as boolean |
275 | 200 | { | 181 | { |
277 | 201 | fn:string(fn:number($value)) ne 'NaN' | 182 | fn:string(fn:number($value)) ne "NaN" |
278 | 202 | }; | 183 | }; |
279 | 203 | 184 | ||
280 | 204 | (:~ | 185 | (:~ |
283 | 205 | : Borrowed from excel module.<br/> | 186 | : Cast the anyAtomicType to a numeric type.<p/> |
282 | 206 | : Cast the xs:anyAtomicType to a numeric type. | ||
284 | 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. |
285 | 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. |
286 | 189 | : <p/> | ||
287 | 190 | : Borrowed from excel module. | ||
288 | 209 | : | 191 | : |
289 | 210 | : @param $number The parameter can be a number, string, boolean value. | 192 | : @param $number The parameter can be a number, string, boolean value. |
290 | 211 | : @return The casted value. | 193 | : @return The casted value. |
292 | 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. |
293 | 213 | :) | 195 | :) |
295 | 214 | declare function math:cast-as-numeric($number as xs:anyAtomicType) as xs:anyAtomicType | 196 | declare function math:cast-as-numeric($number as anyAtomicType) as anyAtomicType |
296 | 215 | { | 197 | { |
297 | 216 | typeswitch ($number) | 198 | typeswitch ($number) |
302 | 217 | case xs:double return $number | 199 | case double return $number |
303 | 218 | case xs:decimal return $number | 200 | case decimal return $number |
304 | 219 | case xs:double return $number | 201 | case double return $number |
305 | 220 | case xs:float return $number | 202 | case float return $number |
306 | 221 | default return | 203 | default return |
313 | 222 | if ($number castable as xs:integer) then | 204 | if ($number castable as integer) then |
314 | 223 | xs:integer($number) | 205 | integer($number) |
315 | 224 | else if ($number castable as xs:decimal) then | 206 | else if ($number castable as decimal) then |
316 | 225 | xs:decimal($number) | 207 | decimal($number) |
317 | 226 | else if ($number castable as xs:double) then | 208 | else if ($number castable as double) then |
318 | 227 | xs:double($number) | 209 | double($number) |
319 | 228 | else | 210 | else |
321 | 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) |
322 | 230 | }; | 212 | }; |
323 | 231 | 213 | ||
324 | 232 | (:~ | 214 | (:~ |
327 | 233 | : Borrowed from excel module.<br/> | 215 | : Returns number rounded up, away from zero, to the nearest multiple of significance.<p/> |
326 | 234 | : Returns number rounded up, away from zero, to the nearest multiple of significance. | ||
328 | 235 | : Significance must have the same sign as number. | 216 | : Significance must have the same sign as number. |
329 | 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. |
331 | 237 | : Significance must not be zero. | 218 | : Significance must not be zero.<p/> |
332 | 219 | : Borrowed from excel module. | ||
333 | 238 | : | 220 | : |
334 | 239 | : @see http://office.microsoft.com/en-us/excel/HP052090071033.aspx | 221 | : @see http://office.microsoft.com/en-us/excel/HP052090071033.aspx |
335 | 240 | : @param $number The value you want to round. | 222 | : @param $number The value you want to round. |
336 | 241 | : @param $significance The multiple to which you want to round. | 223 | : @param $significance The multiple to which you want to round. |
337 | 242 | : @return The rounded value. | 224 | : @return The rounded value. |
339 | 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. |
340 | 244 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq | 226 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq |
341 | 245 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq | 227 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq |
342 | 246 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq | 228 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq |
343 | @@ -250,21 +232,21 @@ | |||
344 | 250 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq | 232 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq |
345 | 251 | :) | 233 | :) |
346 | 252 | declare function math:ceiling( | 234 | declare function math:ceiling( |
349 | 253 | $number as xs:double, | 235 | $number as double, |
350 | 254 | $significance as xs:double) as xs:double | 236 | $significance as double) as double |
351 | 255 | { | 237 | { |
352 | 256 | if ($significance eq 0) then | 238 | if ($significance eq 0) then |
354 | 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") |
355 | 258 | else if ($number * $significance ge 0) then | 240 | else if ($number * $significance ge 0) then |
356 | 259 | fn:ceiling($number div $significance) * $significance | 241 | fn:ceiling($number div $significance) * $significance |
357 | 260 | else | 242 | else |
359 | 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") |
360 | 262 | }; | 244 | }; |
361 | 263 | 245 | ||
362 | 264 | (:~ | 246 | (:~ |
366 | 265 | : Borrowed from excel module.<br/> | 247 | : Returns number rounded up to the nearest even integer.<p/> |
367 | 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/> |
368 | 267 | : Regardless of the sign of number, a value is rounded up when adjusted away from zero. | 249 | : Borrowed from excel module. |
369 | 268 | : | 250 | : |
370 | 269 | : @see http://office.microsoft.com/en-us/excel/HP052090801033.aspx | 251 | : @see http://office.microsoft.com/en-us/excel/HP052090801033.aspx |
371 | 270 | : @param $number The value to round. | 252 | : @param $number The value to round. |
372 | @@ -276,14 +258,14 @@ | |||
373 | 276 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq | 258 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq |
374 | 277 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq | 259 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq |
375 | 278 | :) | 260 | :) |
377 | 279 | declare function math:even($number as xs:double) as xs:integer | 261 | declare function math:even($number as double) as integer |
378 | 280 | { | 262 | { |
379 | 281 | let $num := $number | 263 | let $num := $number |
380 | 282 | return | 264 | return |
382 | 283 | if ($num = 0) then | 265 | if ($num eq 0) then |
383 | 284 | 0 | 266 | 0 |
384 | 285 | else | 267 | else |
386 | 286 | let $intnum := xs:integer(math:ceiling($num, math:sign($num))) | 268 | let $intnum := integer(math:ceiling($num, math:sign($num))) |
387 | 287 | return | 269 | return |
388 | 288 | if ($intnum mod 2 ne 0) then | 270 | if ($intnum mod 2 ne 0) then |
389 | 289 | if ($intnum gt 0) then | 271 | if ($intnum gt 0) then |
390 | @@ -295,58 +277,57 @@ | |||
391 | 295 | }; | 277 | }; |
392 | 296 | 278 | ||
393 | 297 | (:~ | 279 | (:~ |
394 | 280 | : Function for computing factorial.<p/> | ||
395 | 281 | : This recursive function computes: number * fact(number-1)<p/> | ||
396 | 298 | : Borrowed from excel module.<br/> | 282 | : Borrowed from excel module.<br/> |
397 | 299 | : Function for computing factorial. | ||
398 | 300 | : This function should not be used outside this module. | ||
399 | 301 | : This recursive function computes: number * fact(number-1) | ||
400 | 302 | : | 283 | : |
401 | 303 | : @param $intnum A positive integer. | 284 | : @param $intnum A positive integer. |
402 | 304 | : @return The factorial of intnum. | 285 | : @return The factorial of intnum. |
403 | 305 | :) | 286 | :) |
405 | 306 | declare %private function math:fact-integer($intnum as xs:integer) as xs:integer | 287 | declare %private function math:fact-integer($intnum as integer) as integer |
406 | 307 | { | 288 | { |
408 | 308 | if ($intnum = 1) then | 289 | if ($intnum eq 1) then |
409 | 309 | 1 | 290 | 1 |
410 | 310 | else | 291 | else |
411 | 311 | $intnum * math:fact-integer($intnum - 1) | 292 | $intnum * math:fact-integer($intnum - 1) |
412 | 312 | }; | 293 | }; |
413 | 313 | 294 | ||
414 | 314 | (:~ | 295 | (:~ |
417 | 315 | : Borrowed from excel module.<br/> | 296 | : Returns the factorial of a number.<p/> |
418 | 316 | : Returns the factorial of a number. | 297 | : Borrowed from excel module. |
419 | 317 | : | 298 | : |
420 | 318 | : @see http://office.microsoft.com/en-us/excel/HP052090841033.aspx | 299 | : @see http://office.microsoft.com/en-us/excel/HP052090841033.aspx |
421 | 319 | : @param $number The non-negative number you want the factorial of. | 300 | : @param $number The non-negative number you want the factorial of. |
422 | 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. |
424 | 321 | : @error math:errNum if the number is smaller than zero | 302 | : @error math:INVALID_ARGUMENT if the number is smaller than zero |
425 | 322 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq | 303 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq |
426 | 323 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq | 304 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq |
427 | 324 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq | 305 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq |
428 | 325 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq | 306 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq |
429 | 326 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq | 307 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq |
430 | 327 | :) | 308 | :) |
432 | 328 | declare function math:fact($number as xs:integer) as xs:integer | 309 | declare function math:fact($number as integer) as integer |
433 | 329 | { | 310 | { |
434 | 330 | let $num := $number return | 311 | let $num := $number return |
435 | 331 | if ($num eq 0) then | 312 | if ($num eq 0) then |
436 | 332 | 1 | 313 | 1 |
437 | 333 | else | 314 | else |
438 | 334 | if ($num lt 0) then | 315 | if ($num lt 0) then |
440 | 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") |
441 | 336 | else | 317 | else |
443 | 337 | math:fact-integer(xs:integer($num)) | 318 | math:fact-integer(integer($num)) |
444 | 338 | }; | 319 | }; |
445 | 339 | 320 | ||
446 | 340 | (:~ | 321 | (:~ |
449 | 341 | : Borrowed from excel module.<br/> | 322 | : Rounds number down, toward zero, to the nearest multiple of significance.<p/> |
448 | 342 | : Rounds number down, toward zero, to the nearest multiple of significance. | ||
450 | 343 | : Significance must have the same sign as number. | 323 | : Significance must have the same sign as number. |
451 | 324 | : Borrowed from excel module. | ||
452 | 344 | : | 325 | : |
453 | 345 | : @see http://office.microsoft.com/en-us/excel/HP052090941033.aspx | 326 | : @see http://office.microsoft.com/en-us/excel/HP052090941033.aspx |
454 | 346 | : @param $number The value you want to round. | 327 | : @param $number The value you want to round. |
455 | 347 | : @param $significance The multiple to which you want to round. | 328 | : @param $significance The multiple to which you want to round. |
456 | 348 | : @return The rounded value as numeric type. | 329 | : @return The rounded value as numeric type. |
458 | 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. |
459 | 350 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq | 331 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq |
460 | 351 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq | 332 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq |
461 | 352 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq | 333 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq |
462 | @@ -354,24 +335,24 @@ | |||
463 | 354 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq | 335 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq |
464 | 355 | :) | 336 | :) |
465 | 356 | declare function math:floor( | 337 | declare function math:floor( |
468 | 357 | $number as xs:double, | 338 | $number as double, |
469 | 358 | $significance as xs:double) as xs:double | 339 | $significance as double) as double |
470 | 359 | { | 340 | { |
471 | 360 | let $num := $number | 341 | let $num := $number |
472 | 361 | let $sig := $significance | 342 | let $sig := $significance |
473 | 362 | return | 343 | return |
474 | 363 | if ($sig eq 0) then | 344 | if ($sig eq 0) then |
476 | 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") |
477 | 365 | else if ($num * $sig ge 0) then | 346 | else if ($num * $sig ge 0) then |
478 | 366 | fn:floor($num div $sig) * $sig | 347 | fn:floor($num div $sig) * $sig |
479 | 367 | else | 348 | else |
481 | 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") |
482 | 369 | }; | 350 | }; |
483 | 370 | 351 | ||
484 | 371 | (:~ | 352 | (:~ |
488 | 372 | : Borrowed from excel module.<br/> | 353 | : Rounds a number down to the nearest integer.<p/> |
489 | 373 | : Rounds a number down to the nearest integer. | 354 | : Positive numbers are rounded toward zero, negative numbers are rounded away from zero.<p/> |
490 | 374 | : Positive numbers are rounded toward zero, negative numbers are rounded away from zero. | 355 | : Borrowed from excel module. |
491 | 375 | : | 356 | : |
492 | 376 | : @see http://office.microsoft.com/en-us/excel/HP052091421033.aspx | 357 | : @see http://office.microsoft.com/en-us/excel/HP052091421033.aspx |
493 | 377 | : @param $number The value to be rounded. | 358 | : @param $number The value to be rounded. |
494 | @@ -381,35 +362,35 @@ | |||
495 | 381 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq | 362 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq |
496 | 382 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq | 363 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq |
497 | 383 | :) | 364 | :) |
499 | 384 | declare function math:int($number as xs:double) as xs:integer | 365 | declare function math:int($number as double) as integer |
500 | 385 | { | 366 | { |
502 | 386 | xs:integer(fn:floor($number)) | 367 | integer(fn:floor($number)) |
503 | 387 | }; | 368 | }; |
504 | 388 | 369 | ||
505 | 389 | (:~ | 370 | (:~ |
509 | 390 | : Borrowed from excel module.<br/> | 371 | : Returns the remainder after number is divided by divisor.<p/> |
510 | 391 | : Returns the remainder after number is divided by divisor. | 372 | : The result has the same sign as divisor.<p/> |
511 | 392 | : The result has the same sign as divisor. | 373 | : Borrowed from excel module. |
512 | 393 | : | 374 | : |
513 | 394 | : @see http://office.microsoft.com/en-us/excel/HP052091821033.aspx | 375 | : @see http://office.microsoft.com/en-us/excel/HP052091821033.aspx |
514 | 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. |
515 | 396 | : @param $divisor The number by which you want to divide number. | 377 | : @param $divisor The number by which you want to divide number. |
516 | 397 | : This cannot be zero. | 378 | : This cannot be zero. |
517 | 398 | : @return The remainder from division as numeric type. | 379 | : @return The remainder from division as numeric type. |
519 | 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. |
520 | 400 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq | 381 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq |
521 | 401 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq | 382 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq |
522 | 402 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq | 383 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq |
523 | 403 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq | 384 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq |
524 | 404 | :) | 385 | :) |
525 | 405 | declare function math:mod( | 386 | declare function math:mod( |
528 | 406 | $number as xs:double, | 387 | $number as double, |
529 | 407 | $divisor as xs:double) as xs:double | 388 | $divisor as double) as double |
530 | 408 | { | 389 | { |
531 | 409 | let $num := $number | 390 | let $num := $number |
532 | 410 | let $div := $divisor return | 391 | let $div := $divisor return |
533 | 411 | if ($div eq 0) then | 392 | if ($div eq 0) then |
535 | 412 | fn:error($math:errDiv0, "Mod operator: divide by 0") | 393 | fn:error($math:DIVIDE_BY_0, "Mod operator: divide by 0") |
536 | 413 | else | 394 | else |
537 | 414 | let $result := $num mod $div | 395 | let $result := $num mod $div |
538 | 415 | return | 396 | return |
539 | @@ -420,8 +401,8 @@ | |||
540 | 420 | }; | 401 | }; |
541 | 421 | 402 | ||
542 | 422 | (:~ | 403 | (:~ |
545 | 423 | : Borrowed from excel module.<br/> | 404 | : Returns number rounded up to the nearest odd integer, away from zero.<p/> |
546 | 424 | : Returns number rounded up to the nearest odd integer, away from zero. | 405 | : Borrowed from excel module. |
547 | 425 | : | 406 | : |
548 | 426 | : @see http://office.microsoft.com/en-us/excel/HP052092031033.aspx | 407 | : @see http://office.microsoft.com/en-us/excel/HP052092031033.aspx |
549 | 427 | : @param $number The value to round. | 408 | : @param $number The value to round. |
550 | @@ -433,33 +414,32 @@ | |||
551 | 433 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq | 414 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq |
552 | 434 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq | 415 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq |
553 | 435 | :) | 416 | :) |
555 | 436 | declare function math:odd($number as xs:double) as xs:integer | 417 | declare function math:odd($number as double) as integer |
556 | 437 | { | 418 | { |
557 | 438 | let $num := $number return | 419 | let $num := $number return |
558 | 439 | if ($num eq 0) then | 420 | if ($num eq 0) then |
559 | 440 | 1 | 421 | 1 |
560 | 441 | else | 422 | else |
562 | 442 | let $intnum := xs:integer(math:ceiling($num, math:sign($num))) | 423 | let $intnum := integer(math:ceiling($num, math:sign($num))) |
563 | 443 | return | 424 | return |
564 | 444 | if ($intnum mod 2 eq 0) then | 425 | if ($intnum mod 2 eq 0) then |
565 | 445 | if ($intnum ge 0) then | 426 | if ($intnum ge 0) then |
567 | 446 | ($intnum + 1) cast as xs:integer | 427 | ($intnum + 1) cast as integer |
568 | 447 | else | 428 | else |
570 | 448 | ($intnum - 1) cast as xs:integer | 429 | ($intnum - 1) cast as integer |
571 | 449 | else | 430 | else |
573 | 450 | $intnum cast as xs:integer | 431 | $intnum cast as integer |
574 | 451 | }; | 432 | }; |
575 | 452 | 433 | ||
576 | 453 | (:~ | 434 | (:~ |
581 | 454 | : Borrowed from excel module.<br/> | 435 | : Function for product.<p/> |
582 | 455 | : Function for product. | 436 | : Multiplies all numbers in the sequence.<p/> |
583 | 456 | : This function should not be used outside this module. | 437 | : Borrowed from excel module. |
580 | 457 | : Multiplies all numbers in the sequence. | ||
584 | 458 | : | 438 | : |
585 | 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. |
586 | 460 | : @return The multiplication result as numeric type. | 440 | : @return The multiplication result as numeric type. |
587 | 461 | :) | 441 | :) |
589 | 462 | declare %private function math:product-internal($numbers as xs:double*) as xs:double | 442 | declare %private function math:product-internal($numbers as double*) as double |
590 | 463 | { | 443 | { |
591 | 464 | if (fn:empty($numbers)) then | 444 | if (fn:empty($numbers)) then |
592 | 465 | 1 | 445 | 1 |
593 | @@ -470,8 +450,8 @@ | |||
594 | 470 | }; | 450 | }; |
595 | 471 | 451 | ||
596 | 472 | (:~ | 452 | (:~ |
599 | 473 | : Borrowed from excel module.<br/> | 453 | : Multiplies all the numbers given as arguments and returns the product.<p/> |
600 | 474 | : Multiplies all the numbers given as arguments and returns the product. | 454 | : Borrowed from excel module. |
601 | 475 | : | 455 | : |
602 | 476 | : @see http://office.microsoft.com/en-us/excel/HP052092231033.aspx | 456 | : @see http://office.microsoft.com/en-us/excel/HP052092231033.aspx |
603 | 477 | : @param $numbers The sequence of arguments convertible to numeric types. | 457 | : @param $numbers The sequence of arguments convertible to numeric types. |
604 | @@ -483,7 +463,7 @@ | |||
605 | 483 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq | 463 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq |
606 | 484 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq | 464 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq |
607 | 485 | :) | 465 | :) |
609 | 486 | declare function math:product($numbers as xs:double*) as xs:double | 466 | declare function math:product($numbers as double*) as double |
610 | 487 | { | 467 | { |
611 | 488 | if (fn:empty($numbers)) then | 468 | if (fn:empty($numbers)) then |
612 | 489 | 0 | 469 | 0 |
613 | @@ -492,40 +472,40 @@ | |||
614 | 492 | }; | 472 | }; |
615 | 493 | 473 | ||
616 | 494 | (:~ | 474 | (:~ |
619 | 495 | : Borrowed from excel module.<br/> | 475 | : Returns the integer portion of a division.<p/> |
620 | 496 | : Returns the integer portion of a division. | 476 | : Borrowed from excel module. |
621 | 497 | : | 477 | : |
622 | 498 | : @see http://office.microsoft.com/en-us/excel/HP052092271033.aspx | 478 | : @see http://office.microsoft.com/en-us/excel/HP052092271033.aspx |
623 | 499 | : @param $numerator The divider. | 479 | : @param $numerator The divider. |
624 | 500 | : @param $denominator The divisor. It cannot be zero. | 480 | : @param $denominator The divisor. It cannot be zero. |
625 | 501 | : @return The result value as numeric type. | 481 | : @return The result value as numeric type. |
627 | 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. |
628 | 503 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq | 483 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq |
629 | 504 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq | 484 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq |
630 | 505 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq | 485 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq |
631 | 506 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq | 486 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq |
632 | 507 | :) | 487 | :) |
633 | 508 | declare function math:quotient( | 488 | declare function math:quotient( |
636 | 509 | $numerator as xs:double, | 489 | $numerator as double, |
637 | 510 | $denominator as xs:double) as xs:integer | 490 | $denominator as double) as integer |
638 | 511 | { | 491 | { |
639 | 512 | let $numer := $numerator | 492 | let $numer := $numerator |
640 | 513 | let $denom := $denominator | 493 | let $denom := $denominator |
641 | 514 | return | 494 | return |
642 | 515 | if ($denom eq 0) then | 495 | if ($denom eq 0) then |
644 | 516 | fn:error($math:errDiv0, "Quotient function: divide by 0") | 496 | fn:error($math:DIVIDE_BY_0, "Quotient function: divide by 0") |
645 | 517 | else | 497 | else |
647 | 518 | xs:integer($numer div $denom) | 498 | integer($numer div $denom) |
648 | 519 | }; | 499 | }; |
649 | 520 | 500 | ||
650 | 521 | (:~ | 501 | (:~ |
653 | 522 | : Borrowed from excel module.<br/> | 502 | : Rounds a number to a specified number of digits.<p/> |
652 | 523 | : Rounds a number to a specified number of digits. | ||
654 | 524 | : If precision is greater than 0 (zero), then number is rounded | 503 | : If precision is greater than 0 (zero), then number is rounded |
655 | 525 | : to the specified number of decimal places. | 504 | : to the specified number of decimal places. |
656 | 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. |
657 | 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. |
659 | 528 | : The 0.5 is rounded away from zero. | 507 | : The 0.5 is rounded away from zero. <p/> |
660 | 508 | : Borrowed from excel module. | ||
661 | 529 | : | 509 | : |
662 | 530 | : @see http://office.microsoft.com/en-us/excel/HP052092391033.aspx | 510 | : @see http://office.microsoft.com/en-us/excel/HP052092391033.aspx |
663 | 531 | : @param $number The number to round. | 511 | : @param $number The number to round. |
664 | @@ -537,8 +517,8 @@ | |||
665 | 537 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq | 517 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq |
666 | 538 | :) | 518 | :) |
667 | 539 | declare function math:round( | 519 | declare function math:round( |
670 | 540 | $number as xs:double, | 520 | $number as double, |
671 | 541 | $precision as xs:integer) as xs:double | 521 | $precision as integer) as double |
672 | 542 | { | 522 | { |
673 | 543 | let $num := $number | 523 | let $num := $number |
674 | 544 | return | 524 | return |
675 | @@ -559,12 +539,12 @@ | |||
676 | 559 | }; | 539 | }; |
677 | 560 | 540 | ||
678 | 561 | (:~ | 541 | (:~ |
681 | 562 | : Borrowed from excel module.<br/> | 542 | : Rounds a number down, toward zero.<p/> |
680 | 563 | : Rounds a number down, toward zero. | ||
682 | 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 |
683 | 565 | : to the specified number of decimal places. | 544 | : to the specified number of decimal places. |
684 | 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. |
686 | 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/> |
687 | 547 | : Borrowed from excel module. | ||
688 | 568 | : | 548 | : |
689 | 569 | : @see http://office.microsoft.com/en-us/excel/HP052092411033.aspx | 549 | : @see http://office.microsoft.com/en-us/excel/HP052092411033.aspx |
690 | 570 | : @param $number The number to round | 550 | : @param $number The number to round |
691 | @@ -577,8 +557,8 @@ | |||
692 | 577 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq | 557 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq |
693 | 578 | :) | 558 | :) |
694 | 579 | declare function math:rounddown( | 559 | declare function math:rounddown( |
697 | 580 | $number as xs:double, | 560 | $number as double, |
698 | 581 | $precision as xs:integer) as xs:double | 561 | $precision as integer) as double |
699 | 582 | { | 562 | { |
700 | 583 | let $num := $number | 563 | let $num := $number |
701 | 584 | return | 564 | return |
702 | @@ -599,12 +579,12 @@ | |||
703 | 599 | }; | 579 | }; |
704 | 600 | 580 | ||
705 | 601 | (:~ | 581 | (:~ |
708 | 602 | : Borrowed from excel module.<br/> | 582 | : Rounds a number up, away from 0 (zero).<p/> |
707 | 603 | : Rounds a number up, away from 0 (zero). | ||
709 | 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 |
710 | 605 | : to the specified number of decimal places. | 584 | : to the specified number of decimal places. |
711 | 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. |
713 | 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/> |
714 | 587 | : Borrowed from excel module. | ||
715 | 608 | : | 588 | : |
716 | 609 | : @see http://office.microsoft.com/en-us/excel/HP052092421033.aspx | 589 | : @see http://office.microsoft.com/en-us/excel/HP052092421033.aspx |
717 | 610 | : @param $number The number to round | 590 | : @param $number The number to round |
718 | @@ -617,8 +597,8 @@ | |||
719 | 617 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq | 597 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq |
720 | 618 | :) | 598 | :) |
721 | 619 | declare function math:roundup( | 599 | declare function math:roundup( |
724 | 620 | $number as xs:double, | 600 | $number as double, |
725 | 621 | $precision as xs:integer) as xs:double | 601 | $precision as integer) as double |
726 | 622 | { | 602 | { |
727 | 623 | let $num := $number | 603 | let $num := $number |
728 | 624 | return | 604 | return |
729 | @@ -639,10 +619,10 @@ | |||
730 | 639 | }; | 619 | }; |
731 | 640 | 620 | ||
732 | 641 | (:~ | 621 | (:~ |
735 | 642 | : Borrowed from excel module.<br/> | 622 | : Determines the sign of a number. <p/> |
734 | 643 | : Determines the sign of a number. | ||
736 | 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, |
738 | 645 | : and -1 if the number is negative. | 624 | : and -1 if the number is negative.<p/> |
739 | 625 | : Borrowed from excel module. | ||
740 | 646 | : | 626 | : |
741 | 647 | : @see http://office.microsoft.com/en-us/excel/HP052092551033.aspx | 627 | : @see http://office.microsoft.com/en-us/excel/HP052092551033.aspx |
742 | 648 | : @param $number The argument | 628 | : @param $number The argument |
743 | @@ -651,7 +631,7 @@ | |||
744 | 651 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq | 631 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq |
745 | 652 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq | 632 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq |
746 | 653 | :) | 633 | :) |
748 | 654 | declare function math:sign($number as xs:double) as xs:integer | 634 | declare function math:sign($number as double) as integer |
749 | 655 | { | 635 | { |
750 | 656 | let $num := $number | 636 | let $num := $number |
751 | 657 | return | 637 | return |
752 | @@ -664,8 +644,8 @@ | |||
753 | 664 | }; | 644 | }; |
754 | 665 | 645 | ||
755 | 666 | (:~ | 646 | (:~ |
758 | 667 | : Borrowed from excel module.<br/> | 647 | : Truncates a number to an integer by removing the fractional part of the number.<p/> |
759 | 668 | : Truncates a number to an integer by removing the fractional part of the number. | 648 | : Borrowed from excel module. |
760 | 669 | : | 649 | : |
761 | 670 | : @see http://office.microsoft.com/en-us/excel/HP052093241033.aspx | 650 | : @see http://office.microsoft.com/en-us/excel/HP052093241033.aspx |
762 | 671 | : @param $number The argument . | 651 | : @param $number The argument . |
763 | @@ -673,15 +653,15 @@ | |||
764 | 673 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq | 653 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq |
765 | 674 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq | 654 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq |
766 | 675 | :) | 655 | :) |
768 | 676 | declare function math:trunc($number as xs:double ) as xs:integer | 656 | declare function math:trunc($number as double ) as integer |
769 | 677 | { | 657 | { |
771 | 678 | xs:integer($number) | 658 | integer($number) |
772 | 679 | }; | 659 | }; |
773 | 680 | 660 | ||
774 | 681 | (:~ | 661 | (:~ |
778 | 682 | : Borrowed from excel module.<br/> | 662 | : Truncates a number down to precision.<p/> |
779 | 683 | : Truncates a number down to precision. | 663 | : This behaves exactly like rounddown.<p/> |
780 | 684 | : This behaves exactly like rounddown. | 664 | : Borrowed from excel module. |
781 | 685 | : | 665 | : |
782 | 686 | : @see http://office.microsoft.com/en-us/excel/HP052093241033.aspx | 666 | : @see http://office.microsoft.com/en-us/excel/HP052093241033.aspx |
783 | 687 | : @param $number The argument castable to numeric type. | 667 | : @param $number The argument castable to numeric type. |
784 | @@ -690,22 +670,22 @@ | |||
785 | 690 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq | 670 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq |
786 | 691 | :) | 671 | :) |
787 | 692 | declare function math:trunc( | 672 | declare function math:trunc( |
790 | 693 | $number as xs:double, | 673 | $number as double, |
791 | 694 | $precision as xs:integer) as xs:double | 674 | $precision as integer) as double |
792 | 695 | { | 675 | { |
793 | 696 | math:rounddown($number, $precision) | 676 | math:rounddown($number, $precision) |
794 | 697 | }; | 677 | }; |
795 | 698 | 678 | ||
796 | 699 | (:~ | 679 | (:~ |
798 | 700 | : Borrowed from excel module.<br/> | 680 | : Sorts a sequence of numbers or arguments castable to numeric.<p/> |
799 | 681 | : It first casts all arguments to numeric and then sorts ascending.<p/> | ||
800 | 701 | : Helper function.<br/> | 682 | : Helper function.<br/> |
803 | 702 | : Sorts a sequence of numbers or arguments castable to numeric. | 683 | : Borrowed from excel module. |
802 | 703 | : It first casts all arguments to numeric and then sorts ascending. | ||
804 | 704 | : | 684 | : |
805 | 705 | : @param $numbers The sequence of arguments castable to numeric. | 685 | : @param $numbers The sequence of arguments castable to numeric. |
806 | 706 | : @return The sorted sequence as numeric types. | 686 | : @return The sorted sequence as numeric types. |
807 | 707 | :) | 687 | :) |
809 | 708 | declare function math:sort-numbers($numbers as xs:double*) as xs:double* | 688 | declare function math:sort-numbers($numbers as double*) as double* |
810 | 709 | { | 689 | { |
811 | 710 | let $sorted-numbers := | 690 | let $sorted-numbers := |
812 | 711 | ( | 691 | ( |
813 | @@ -718,21 +698,21 @@ | |||
814 | 718 | }; | 698 | }; |
815 | 719 | 699 | ||
816 | 720 | (:~ | 700 | (:~ |
820 | 721 | : Borrowed from excel module.<br/> | 701 | : Returns the double factorial of a number.<p/> |
821 | 722 | : Returns the double factorial of a number. | 702 | : Computes the double factorial of n as n(n-2)(n-4)...<p/> |
822 | 723 | : Computes the double factorial of n as n(n-2)(n-4)... | 703 | : Borrowed from excel module. |
823 | 724 | : | 704 | : |
824 | 725 | : @see http://office.microsoft.com/en-us/excel/HP052090851033.aspx | 705 | : @see http://office.microsoft.com/en-us/excel/HP052090851033.aspx |
825 | 726 | : @param $number The positive integer value. | 706 | : @param $number The positive integer value. |
826 | 727 | : @return The result as integer. | 707 | : @return The result as integer. |
828 | 728 | : @error math:errNum if the number is negative. | 708 | : @error math:INVALID_ARGUMENT if the number is negative. |
829 | 729 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq | 709 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq |
830 | 730 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq | 710 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq |
831 | 731 | :) | 711 | :) |
833 | 732 | declare function math:factdouble($number as xs:integer) as xs:integer | 712 | declare function math:factdouble($number as integer) as integer |
834 | 733 | { | 713 | { |
835 | 734 | if ($number lt 0) then | 714 | if ($number lt 0) then |
837 | 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") |
838 | 736 | else if ($number eq 1) then | 716 | else if ($number eq 1) then |
839 | 737 | 1 | 717 | 1 |
840 | 738 | else if ($number eq 2) then | 718 | else if ($number eq 2) then |
841 | @@ -742,16 +722,15 @@ | |||
842 | 742 | }; | 722 | }; |
843 | 743 | 723 | ||
844 | 744 | (:~ | 724 | (:~ |
848 | 745 | : Borrowed from excel module.<br/> | 725 | : Function for computing GCD.<p/> |
846 | 746 | : Function for computing GCD. | ||
847 | 747 | : This function should not be used outside this module. | ||
849 | 748 | : It calculates the minimum value from a sequence of positive integers, | 726 | : It calculates the minimum value from a sequence of positive integers, |
851 | 749 | : not taking into account the zero value. | 727 | : not taking into account the zero value.<p/> |
852 | 728 | : Borrowed from excel module. | ||
853 | 750 | : | 729 | : |
854 | 751 | : @param $numbers The sequence of positive integers. | 730 | : @param $numbers The sequence of positive integers. |
855 | 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. |
856 | 753 | :) | 732 | :) |
858 | 754 | declare %private function math:min-without-zero($numbers as xs:integer+) as xs:integer | 733 | declare %private function math:min-without-zero($numbers as integer+) as integer |
859 | 755 | { | 734 | { |
860 | 756 | if (fn:count($numbers) eq 1) then | 735 | if (fn:count($numbers) eq 1) then |
861 | 757 | $numbers[1] | 736 | $numbers[1] |
862 | @@ -769,36 +748,33 @@ | |||
863 | 769 | }; | 748 | }; |
864 | 770 | 749 | ||
865 | 771 | (:~ | 750 | (:~ |
870 | 772 | : Borrowed from excel module.<br/> | 751 | : Function for computing GCD.<p/> |
871 | 773 | : Function for computing GCD. | 752 | : Checks if all integer numbers from a sequence divide exactly to a divider.<p/> |
872 | 774 | : This function should not be used outside this module. | 753 | : Borrowed from excel module. |
869 | 775 | : Checks if all integer numbers from a sequence divide exactly to a divider. | ||
873 | 776 | : | 754 | : |
874 | 777 | : @param $numbers The positive integers. | 755 | : @param $numbers The positive integers. |
875 | 778 | : @param $divider The divider to be tried. | 756 | : @param $divider The divider to be tried. |
876 | 779 | : @return true if the numbers divide exactly. | 757 | : @return true if the numbers divide exactly. |
877 | 780 | :) | 758 | :) |
878 | 781 | declare %private function math:try-exact-divide( | 759 | declare %private function math:try-exact-divide( |
881 | 782 | $numbers as xs:integer*, | 760 | $numbers as integer*, |
882 | 783 | $divider as xs:integer) as xs:boolean | 761 | $divider as integer) as boolean |
883 | 784 | { | 762 | { |
884 | 785 | if (fn:empty($numbers)) then | 763 | if (fn:empty($numbers)) then |
886 | 786 | fn:true() | 764 | true |
887 | 787 | else | 765 | else |
888 | 788 | if ($numbers[1] mod $divider ne 0) then | 766 | if ($numbers[1] mod $divider ne 0) then |
890 | 789 | fn:false() | 767 | false |
891 | 790 | else | 768 | else |
892 | 791 | math:try-exact-divide(fn:subsequence($numbers, 2), $divider) | 769 | math:try-exact-divide(fn:subsequence($numbers, 2), $divider) |
893 | 792 | }; | 770 | }; |
894 | 793 | 771 | ||
895 | 794 | (:~ | 772 | (:~ |
899 | 795 | : Borrowed from excel module.<br/> | 773 | : Function for computing GCD.<p/> |
897 | 796 | : Function for computing GCD. | ||
898 | 797 | : This function should not be used outside this module. | ||
900 | 798 | : This function iterates through possible divisors and checks if the sequence | 774 | : This function iterates through possible divisors and checks if the sequence |
901 | 799 | : divides exactly to any of those. It starts from the minimum value from the | 775 | : divides exactly to any of those. It starts from the minimum value from the |
904 | 800 | : sequence and searches downwards. | 776 | : sequence and searches downwards.<p/> |
905 | 801 | : | 777 | : Borrowed from excel module. |
906 | 802 | : @param $numbers The sequence of positive integers. | 778 | : @param $numbers The sequence of positive integers. |
907 | 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. |
908 | 804 | : @param $iteration Which iteration is it. It starts from 1 and continues | 780 | : @param $iteration Which iteration is it. It starts from 1 and continues |
909 | @@ -806,9 +782,9 @@ | |||
910 | 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. |
911 | 807 | :) | 783 | :) |
912 | 808 | declare %private function math:iterate-all-gcd( | 784 | declare %private function math:iterate-all-gcd( |
916 | 809 | $numbers as xs:integer*, | 785 | $numbers as integer*, |
917 | 810 | $min-nonzero as xs:integer, | 786 | $min-nonzero as integer, |
918 | 811 | $iteration as xs:integer) as xs:integer | 787 | $iteration as integer) as integer |
919 | 812 | { | 788 | { |
920 | 813 | if ($min-nonzero mod $iteration eq 0) then | 789 | if ($min-nonzero mod $iteration eq 0) then |
921 | 814 | if (math:try-exact-divide($numbers, $min-nonzero idiv $iteration)) then | 790 | if (math:try-exact-divide($numbers, $min-nonzero idiv $iteration)) then |
922 | @@ -816,21 +792,21 @@ | |||
923 | 816 | else | 792 | else |
924 | 817 | math:iterate-all-gcd($numbers, $min-nonzero, $iteration + 1) | 793 | math:iterate-all-gcd($numbers, $min-nonzero, $iteration + 1) |
925 | 818 | else | 794 | else |
927 | 819 | if ($iteration > $min-nonzero idiv 2) then | 795 | if ($iteration gt $min-nonzero idiv 2) then |
928 | 820 | 1 | 796 | 1 |
929 | 821 | else | 797 | else |
930 | 822 | math:iterate-all-gcd($numbers, $min-nonzero, $iteration + 1) | 798 | math:iterate-all-gcd($numbers, $min-nonzero, $iteration + 1) |
931 | 823 | }; | 799 | }; |
932 | 824 | 800 | ||
933 | 825 | (:~ | 801 | (:~ |
937 | 826 | : Borrowed from excel module.<br/> | 802 | : Returns the greatest common divisor GCD of a sequence of integers.<p/> |
938 | 827 | : Returns the greatest common divisor GCD of a sequence of integers. | 803 | : The sequence can have one or more positive integers.<p/> |
939 | 828 | : The sequence can have one or more positive integers. | 804 | : Borrowed from excel module. |
940 | 829 | : | 805 | : |
941 | 830 | : @see http://office.microsoft.com/en-us/excel/HP052091041033.aspx | 806 | : @see http://office.microsoft.com/en-us/excel/HP052091041033.aspx |
942 | 831 | : @param $numbers The sequence of positive integers. | 807 | : @param $numbers The sequence of positive integers. |
943 | 832 | : @return The GCD as integer. | 808 | : @return The GCD as integer. |
945 | 833 | : @error math:errNum if any number is smaller than zero. | 809 | : @error math:INVALID_ARGUMENT if any number is smaller than zero. |
946 | 834 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq | 810 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq |
947 | 835 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq | 811 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq |
948 | 836 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq | 812 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq |
949 | @@ -840,15 +816,15 @@ | |||
950 | 840 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq | 816 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq |
951 | 841 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq | 817 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq |
952 | 842 | :) | 818 | :) |
954 | 843 | declare function math:gcd($numbers as xs:integer+) as xs:integer | 819 | declare function math:gcd($numbers as integer+) as integer |
955 | 844 | { | 820 | { |
957 | 845 | if (fn:count($numbers) = 1) then | 821 | if (fn:count($numbers) eq 1) then |
958 | 846 | $numbers[1] | 822 | $numbers[1] |
959 | 847 | else | 823 | else |
960 | 848 | let $minval := math:min-without-zero($numbers) | 824 | let $minval := math:min-without-zero($numbers) |
961 | 849 | return | 825 | return |
962 | 850 | if ($minval lt 0) then | 826 | if ($minval lt 0) then |
964 | 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") |
965 | 852 | else if ($minval eq 0) then | 828 | else if ($minval eq 0) then |
966 | 853 | 0 | 829 | 0 |
967 | 854 | else | 830 | else |
968 | @@ -856,22 +832,22 @@ | |||
969 | 856 | }; | 832 | }; |
970 | 857 | 833 | ||
971 | 858 | (:~ | 834 | (:~ |
976 | 859 | : Borrowed from excel module.<br/> | 835 | : Returns the least common multiple of integers.<p/> |
977 | 860 | : Returns the least common multiple of integers.<br/> | 836 | : LCM for two numbers is computed by multiplying them and dividing with GCD. |
978 | 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/> |
979 | 862 | : The function is applied recursively replacing the first two numbers in the sequence with their LCM. | 838 | : Borrowed from excel module. |
980 | 863 | : | 839 | : |
981 | 864 | : @see http://office.microsoft.com/en-us/excel/HP052091521033.aspx | 840 | : @see http://office.microsoft.com/en-us/excel/HP052091521033.aspx |
982 | 865 | : @param $numbers The sequence of one or more positive integers. | 841 | : @param $numbers The sequence of one or more positive integers. |
983 | 866 | : @return The LCM as integer. | 842 | : @return The LCM as integer. |
985 | 867 | : @error math:errNum if any number is smaller than zero. | 843 | : @error math:INVALID_ARGUMENT if any number is smaller than zero. |
986 | 868 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq | 844 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq |
987 | 869 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq | 845 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq |
988 | 870 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq | 846 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq |
989 | 871 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq | 847 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq |
990 | 872 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq | 848 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq |
991 | 873 | :) | 849 | :) |
993 | 874 | declare function math:lcm($numbers as xs:integer+) as xs:integer | 850 | declare function math:lcm($numbers as integer+) as integer |
994 | 875 | { | 851 | { |
995 | 876 | if(count($numbers) eq 1) then | 852 | if(count($numbers) eq 1) then |
996 | 877 | $numbers[1] | 853 | $numbers[1] |
997 | @@ -889,11 +865,11 @@ | |||
998 | 889 | }; | 865 | }; |
999 | 890 | 866 | ||
1000 | 891 | (:~ | 867 | (:~ |
1003 | 892 | : Borrowed from excel module.<br/> | 868 | : Returns a number rounded to the desired multiple.<p/> |
1002 | 893 | : Returns a number rounded to the desired multiple. | ||
1004 | 894 | : MROUND rounds up, away from zero, if the remainder of dividing number by multiple | 869 | : MROUND rounds up, away from zero, if the remainder of dividing number by multiple |
1005 | 895 | : is greater than or equal to half the value of multiple. | 870 | : is greater than or equal to half the value of multiple. |
1007 | 896 | : MROUND is computed through math:floor function. | 871 | : MROUND is computed through math:floor function.<p/> |
1008 | 872 | : Borrowed from excel module. | ||
1009 | 897 | : | 873 | : |
1010 | 898 | : @see http://office.microsoft.com/en-us/excel/HP052091851033.aspx | 874 | : @see http://office.microsoft.com/en-us/excel/HP052091851033.aspx |
1011 | 899 | : @param $number The value to round, | 875 | : @param $number The value to round, |
1012 | @@ -904,8 +880,8 @@ | |||
1013 | 904 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq | 880 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq |
1014 | 905 | :) | 881 | :) |
1015 | 906 | declare function math:mround( | 882 | declare function math:mround( |
1018 | 907 | $number as xs:decimal, | 883 | $number as decimal, |
1019 | 908 | $multiple as xs:double) as xs:double | 884 | $multiple as double) as double |
1020 | 909 | { | 885 | { |
1021 | 910 | let $num := $number | 886 | let $num := $number |
1022 | 911 | let $mul := $multiple | 887 | let $mul := $multiple |
1023 | @@ -923,25 +899,25 @@ | |||
1024 | 923 | }; | 899 | }; |
1025 | 924 | 900 | ||
1026 | 925 | (:~ | 901 | (:~ |
1030 | 926 | : Borrowed from excel module.<br/> | 902 | : Converts an Arabic numeral to roman, as text.<p/> |
1031 | 927 | : Converts an Arabic numeral to roman, as text. | 903 | : Only the classic format is supported (out of all formats Excel requires). |
1029 | 928 | : Only the classic format is supported (out of all formats Excel requires).<br/> | ||
1032 | 929 | : M is the largest digit, it represents 1000. | 904 | : M is the largest digit, it represents 1000. |
1035 | 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". |
1036 | 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/> |
1037 | 907 | : Borrowed from excel module. | ||
1038 | 932 | : | 908 | : |
1039 | 933 | : @see http://office.microsoft.com/en-us/excel/HP052092381033.aspx | 909 | : @see http://office.microsoft.com/en-us/excel/HP052092381033.aspx |
1040 | 934 | : @param $number A positive integer. | 910 | : @param $number A positive integer. |
1041 | 935 | : @return The roman string representation. | 911 | : @return The roman string representation. |
1043 | 936 | : @error math:errNum if the input integer is negative | 912 | : @error math:INVALID_ARGUMENT if the input integer is negative |
1044 | 937 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq | 913 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq |
1045 | 938 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq | 914 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq |
1046 | 939 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq | 915 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq |
1047 | 940 | :) | 916 | :) |
1049 | 941 | declare function math:roman($number as xs:integer) as xs:string | 917 | declare function math:roman($number as integer) as string |
1050 | 942 | { | 918 | { |
1051 | 943 | if ($number lt 0) then | 919 | if ($number lt 0) then |
1053 | 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") |
1054 | 945 | else if ($number ge 1000) then | 921 | else if ($number ge 1000) then |
1055 | 946 | fn:concat("M", math:roman($number - 1000)) | 922 | fn:concat("M", math:roman($number - 1000)) |
1056 | 947 | else if ($number ge 900) then | 923 | else if ($number ge 900) then |
1057 | @@ -1003,9 +979,9 @@ | |||
1058 | 1003 | }; | 979 | }; |
1059 | 1004 | 980 | ||
1060 | 1005 | (:~ | 981 | (:~ |
1061 | 1006 | : Borrowed from excel module.<br/> | ||
1062 | 1007 | : Multiplies the elements on the same position in each sequence | 982 | : Multiplies the elements on the same position in each sequence |
1064 | 1008 | : and sums up the results. | 983 | : and sums up the results.<p/> |
1065 | 984 | : Borrowed from excel module. | ||
1066 | 1009 | : | 985 | : |
1067 | 1010 | : @see http://office.microsoft.com/en-us/excel/HP052092931033.aspx | 986 | : @see http://office.microsoft.com/en-us/excel/HP052092931033.aspx |
1068 | 1011 | : @param $array1 the sequences of numbers | 987 | : @param $array1 the sequences of numbers |
1069 | @@ -1013,8 +989,8 @@ | |||
1070 | 1013 | : @return the sum of products | 989 | : @return the sum of products |
1071 | 1014 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq | 990 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq |
1072 | 1015 | :) | 991 | :) |
1075 | 1016 | declare function math:sumproduct( $array1 as xs:double*, | 992 | declare function math:sumproduct( $array1 as double*, |
1076 | 1017 | $array2 as xs:double* ) as xs:double | 993 | $array2 as double* ) as double |
1077 | 1018 | { | 994 | { |
1078 | 1019 | if( fn:empty($array1) or | 995 | if( fn:empty($array1) or |
1079 | 1020 | fn:empty($array2)) | 996 | fn:empty($array2)) |
1080 | @@ -1026,16 +1002,16 @@ | |||
1081 | 1026 | }; | 1002 | }; |
1082 | 1027 | 1003 | ||
1083 | 1028 | (:~ | 1004 | (:~ |
1087 | 1029 | : Borrowed from excel module.<br/> | 1005 | : Returns the sum of the squares of the arguments.<p/> |
1088 | 1030 | : Returns the sum of the squares of the arguments. | 1006 | : It uses the sumproduct function.<p/> |
1089 | 1031 | : It uses the sumproduct function. | 1007 | : Borrowed from excel module. |
1090 | 1032 | : | 1008 | : |
1091 | 1033 | : @see http://office.microsoft.com/en-us/excel/HP052092951033.aspx | 1009 | : @see http://office.microsoft.com/en-us/excel/HP052092951033.aspx |
1092 | 1034 | : @param $numbers the sequence of one or more numbers | 1010 | : @param $numbers the sequence of one or more numbers |
1093 | 1035 | : @return the sum of squared values, as numeric type | 1011 | : @return the sum of squared values, as numeric type |
1094 | 1036 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq | 1012 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq |
1095 | 1037 | :) | 1013 | :) |
1097 | 1038 | declare function math:sumsq( $numbers as xs:double+) as xs:double | 1014 | declare function math:sumsq( $numbers as double+) as double |
1098 | 1039 | { | 1015 | { |
1099 | 1040 | math:sumproduct($numbers, $numbers) | 1016 | math:sumproduct($numbers, $numbers) |
1100 | 1041 | }; | 1017 | }; |
1101 | @@ -1045,12 +1021,11 @@ | |||
1102 | 1045 | (:Excel statistical functions :) | 1021 | (:Excel statistical functions :) |
1103 | 1046 | 1022 | ||
1104 | 1047 | (:~ | 1023 | (:~ |
1107 | 1048 | : Borrowed from excel module.<br/> | 1024 | : Returns the median of the given numbers. <p/> |
1106 | 1049 | : Returns the median of the given numbers. | ||
1108 | 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. |
1109 | 1051 | : Half the numbers have values that are greater than the median, | 1026 | : Half the numbers have values that are greater than the median, |
1112 | 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/> |
1113 | 1053 | : | 1028 | : Borrowed from excel module. |
1114 | 1054 | : | 1029 | : |
1115 | 1055 | : @see http://office.microsoft.com/en-us/excel/HP052091741033.aspx | 1030 | : @see http://office.microsoft.com/en-us/excel/HP052091741033.aspx |
1116 | 1056 | : @param $numbers the sequence of numbers, of any length | 1031 | : @param $numbers the sequence of numbers, of any length |
1117 | @@ -1059,71 +1034,71 @@ | |||
1118 | 1059 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq | 1034 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq |
1119 | 1060 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq | 1035 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq |
1120 | 1061 | :) | 1036 | :) |
1122 | 1062 | declare function math:median( $numbers as xs:double* ) as xs:double | 1037 | declare function math:median( $numbers as double* ) as double |
1123 | 1063 | { | 1038 | { |
1124 | 1064 | let $number_count := fn:count( $numbers ) | 1039 | let $number_count := fn:count( $numbers ) |
1125 | 1065 | let $sorted_numbers := math:sort-numbers( $numbers ) return | 1040 | let $sorted_numbers := math:sort-numbers( $numbers ) return |
1127 | 1066 | if ($number_count mod 2 != 0) then | 1041 | if ($number_count mod 2 ne 0) then |
1128 | 1067 | $sorted_numbers[$number_count idiv 2 + 1] | 1042 | $sorted_numbers[$number_count idiv 2 + 1] |
1129 | 1068 | else | 1043 | else |
1131 | 1069 | if ($number_count = 0) then | 1044 | if ($number_count eq 0) then |
1132 | 1070 | 0 | 1045 | 0 |
1133 | 1071 | else | 1046 | else |
1134 | 1072 | ($sorted_numbers[$number_count idiv 2] + $sorted_numbers[$number_count idiv 2 + 1] ) div 2 | 1047 | ($sorted_numbers[$number_count idiv 2] + $sorted_numbers[$number_count idiv 2 + 1] ) div 2 |
1135 | 1073 | }; | 1048 | }; |
1136 | 1074 | 1049 | ||
1137 | 1075 | (:~ | 1050 | (:~ |
1140 | 1076 | : Borrowed from excel module.<br/> | 1051 | : Returns the most frequently occurring, or repetitive, value in a sequence.<p/> |
1141 | 1077 | : Returns the most frequently occurring, or repetitive, value in a sequence. | 1052 | : Borrowed from excel module. |
1142 | 1078 | : | 1053 | : |
1143 | 1079 | : @see http://office.microsoft.com/en-us/excel/HP052091831033.aspx | 1054 | : @see http://office.microsoft.com/en-us/excel/HP052091831033.aspx |
1144 | 1080 | : @param $numbers the sequence of numbers, of any length | 1055 | : @param $numbers the sequence of numbers, of any length |
1145 | 1081 | : @return The most occuring number | 1056 | : @return The most occuring number |
1147 | 1082 | : @error math:errNA if there are no duplicate numbers | 1057 | : @error math:INVALID_INPUT if there are no duplicate numbers |
1148 | 1083 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq | 1058 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq |
1149 | 1084 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq | 1059 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq |
1150 | 1085 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq | 1060 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq |
1151 | 1086 | :) | 1061 | :) |
1153 | 1087 | declare function math:mode( $numbers as xs:double* ) as xs:double | 1062 | declare function math:mode( $numbers as double* ) as double |
1154 | 1088 | { | 1063 | { |
1155 | 1089 | if ( fn:empty($numbers)) then | 1064 | if ( fn:empty($numbers)) then |
1157 | 1090 | fn:error($math:errNA, "Mode function: empty sequence") | 1065 | fn:error($math:INVALID_INPUT, "Mode function: empty sequence") |
1158 | 1091 | else | 1066 | else |
1159 | 1092 | let $result := | 1067 | let $result := |
1160 | 1093 | ( for $n_at in fn:distinct-values($numbers) | 1068 | ( for $n_at in fn:distinct-values($numbers) |
1161 | 1094 | let $n := $n_at | 1069 | let $n := $n_at |
1162 | 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) ) |
1164 | 1096 | where $count > 1 | 1071 | where $count gt 1 |
1165 | 1097 | order by $count descending | 1072 | order by $count descending |
1166 | 1098 | return $n | 1073 | return $n |
1167 | 1099 | ) return | 1074 | ) return |
1168 | 1100 | if (fn:empty($result)) then | 1075 | if (fn:empty($result)) then |
1170 | 1101 | fn:error($math:errNA, "Mode function: no duplicate elements") | 1076 | fn:error($math:INVALID_INPUT, "Mode function: no duplicate elements") |
1171 | 1102 | else | 1077 | else |
1172 | 1103 | $result[1] | 1078 | $result[1] |
1173 | 1104 | }; | 1079 | }; |
1174 | 1105 | 1080 | ||
1175 | 1106 | (:~ | 1081 | (:~ |
1178 | 1107 | : Borrowed from excel module.<br/> | 1082 | : Returns the k-th percentile of values in a sequence.<p/> |
1177 | 1108 | : Returns the k-th percentile of values in a sequence. | ||
1179 | 1109 | : If k is not a multiple of 1/(n - 1), | 1083 | : If k is not a multiple of 1/(n - 1), |
1180 | 1110 | : PERCENTILE interpolates to determine the value at the k-th percentile. | 1084 | : PERCENTILE interpolates to determine the value at the k-th percentile. |
1182 | 1111 | : The function is computed by (max-min)*k + min | 1085 | : The function is computed by (max-min)*k + min<p/> |
1183 | 1086 | : Borrowed from excel module. | ||
1184 | 1112 | : | 1087 | : |
1185 | 1113 | : @see http://office.microsoft.com/en-us/excel/HP052092111033.aspx | 1088 | : @see http://office.microsoft.com/en-us/excel/HP052092111033.aspx |
1186 | 1114 | : @param $numbers the sequence of numbers, of any length | 1089 | : @param $numbers the sequence of numbers, of any length |
1187 | 1115 | : @param $k_at the percentile, with value between 0 .. 1 inclusive | 1090 | : @param $k_at the percentile, with value between 0 .. 1 inclusive |
1188 | 1116 | : @return The computed percentile | 1091 | : @return The computed percentile |
1190 | 1117 | : @error math:errNum if percentile is not between 0 .. 1 | 1092 | : @error math:INVALID_ARGUMENT if percentile is not between 0 .. 1 |
1191 | 1118 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq | 1093 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq |
1192 | 1119 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq | 1094 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq |
1193 | 1120 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq | 1095 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq |
1194 | 1121 | :) | 1096 | :) |
1196 | 1122 | declare function math:percentile( $numbers as xs:double*, $k_at as xs:double) as xs:double | 1097 | declare function math:percentile( $numbers as double*, $k_at as double) as double |
1197 | 1123 | { | 1098 | { |
1198 | 1124 | let $k := $k_at return | 1099 | let $k := $k_at return |
1201 | 1125 | if ($k < 0 or $k > 1) then | 1100 | if ($k lt 0 or $k gt 1) then |
1202 | 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") |
1203 | 1127 | else | 1102 | else |
1204 | 1128 | let $max := fn:max($numbers) | 1103 | let $max := fn:max($numbers) |
1205 | 1129 | let $min := fn:min($numbers) return | 1104 | let $min := fn:min($numbers) return |
1206 | @@ -1133,10 +1108,9 @@ | |||
1207 | 1133 | 1108 | ||
1208 | 1134 | 1109 | ||
1209 | 1135 | (:~ | 1110 | (:~ |
1214 | 1136 | : Borrowed from excel module.<br/> | 1111 | : Function for AVEDEV.<p/> |
1215 | 1137 | : Function for AVEDEV. | 1112 | : Computes formula sum(abs(x - average)) for every x in $numbers<p/> |
1216 | 1138 | : This function should not be used outside this module. | 1113 | : Borrowed from excel module. |
1213 | 1139 | : Computes formula sum(abs(x - average)) for every x in $numbers | ||
1217 | 1140 | : | 1114 | : |
1218 | 1141 | : @param $numbers The sequence of numbers. | 1115 | : @param $numbers The sequence of numbers. |
1219 | 1142 | : Sequence can be of any length. | 1116 | : Sequence can be of any length. |
1220 | @@ -1144,8 +1118,8 @@ | |||
1221 | 1144 | : @return The result of the formula. | 1118 | : @return The result of the formula. |
1222 | 1145 | :) | 1119 | :) |
1223 | 1146 | declare %private function math:sum-deviations( | 1120 | declare %private function math:sum-deviations( |
1226 | 1147 | $numbers as xs:double*, | 1121 | $numbers as double*, |
1227 | 1148 | $average as xs:double) as xs:double | 1122 | $average as double) as double |
1228 | 1149 | { | 1123 | { |
1229 | 1150 | if (fn:empty($numbers)) then | 1124 | if (fn:empty($numbers)) then |
1230 | 1151 | 0 | 1125 | 0 |
1231 | @@ -1154,9 +1128,9 @@ | |||
1232 | 1154 | }; | 1128 | }; |
1233 | 1155 | 1129 | ||
1234 | 1156 | (:~ | 1130 | (:~ |
1238 | 1157 | : Borrowed from excel module.<br/> | 1131 | : Returns the average of the absolute deviations of data points from their mean.<p/> |
1239 | 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/> |
1240 | 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. |
1241 | 1160 | : | 1134 | : |
1242 | 1161 | : @see http://office.microsoft.com/en-us/excel/HP052089931033.aspx | 1135 | : @see http://office.microsoft.com/en-us/excel/HP052089931033.aspx |
1243 | 1162 | : @param $numbers the sequence of numbers. | 1136 | : @param $numbers the sequence of numbers. |
1244 | @@ -1164,36 +1138,36 @@ | |||
1245 | 1164 | : @return The formula result | 1138 | : @return The formula result |
1246 | 1165 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq | 1139 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq |
1247 | 1166 | :) | 1140 | :) |
1249 | 1167 | declare function math:avedev($numbers as xs:double+) as xs:double | 1141 | declare function math:avedev($numbers as double+) as double |
1250 | 1168 | { | 1142 | { |
1251 | 1169 | let $average := fn:avg($numbers) return | 1143 | let $average := fn:avg($numbers) return |
1252 | 1170 | math:sum-deviations($numbers, $average) div fn:count($numbers) | 1144 | math:sum-deviations($numbers, $average) div fn:count($numbers) |
1253 | 1171 | }; | 1145 | }; |
1254 | 1172 | 1146 | ||
1255 | 1173 | (:~ | 1147 | (:~ |
1258 | 1174 | : Borrowed from excel module.<br/> | 1148 | : Returns the k-th largest value in a data set. <p/> |
1257 | 1175 | : Returns the k-th largest value in a data set. | ||
1259 | 1176 | : If n is the number of data points in a range, | 1149 | : If n is the number of data points in a range, |
1260 | 1177 | : then LARGE(array,1) returns the largest value, | 1150 | : then LARGE(array,1) returns the largest value, |
1262 | 1178 | : and LARGE(array,n) returns the smallest value. | 1151 | : and LARGE(array,n) returns the smallest value.<p/> |
1263 | 1152 | : Borrowed from excel module.<br/> | ||
1264 | 1179 | : | 1153 | : |
1265 | 1180 | : @see http://office.microsoft.com/en-us/excel/HP052091511033.aspx | 1154 | : @see http://office.microsoft.com/en-us/excel/HP052091511033.aspx |
1266 | 1181 | : @param $numbers the sequence of numbers | 1155 | : @param $numbers the sequence of numbers |
1267 | 1182 | : The sequence can be of any length, from 1 up. | 1156 | : The sequence can be of any length, from 1 up. |
1268 | 1183 | : @param $k the position of largest value, with value from 1 to count of values | 1157 | : @param $k the position of largest value, with value from 1 to count of values |
1269 | 1184 | : @return The k-th largest value as numeric type | 1158 | : @return The k-th largest value as numeric type |
1271 | 1185 | : @error math:errNum if the sequence is empty or k is not a value between 1 | 1159 | : @error math:INVALID_ARGUMENT if the sequence is empty or k is not a value between 1 |
1272 | 1186 | : and the size of the sequence | 1160 | : and the size of the sequence |
1273 | 1187 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq | 1161 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq |
1274 | 1188 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq | 1162 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq |
1275 | 1189 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq | 1163 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq |
1276 | 1190 | :) | 1164 | :) |
1278 | 1191 | declare function math:large($numbers as xs:double+, $k as xs:integer) as xs:double | 1165 | declare function math:large($numbers as double+, $k as integer) as double |
1279 | 1192 | { | 1166 | { |
1280 | 1193 | if (fn:empty($numbers)) then | 1167 | if (fn:empty($numbers)) then |
1284 | 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") |
1285 | 1195 | else if ($k > fn:count($numbers) or $k le 0) then | 1169 | else if ($k gt fn:count($numbers) or $k le 0) then |
1286 | 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) |
1287 | 1197 | else | 1171 | else |
1288 | 1198 | let $ordered_numbers := | 1172 | let $ordered_numbers := |
1289 | 1199 | (for $n in $numbers | 1173 | (for $n in $numbers |
1290 | @@ -1205,11 +1179,11 @@ | |||
1291 | 1205 | }; | 1179 | }; |
1292 | 1206 | 1180 | ||
1293 | 1207 | (:~ | 1181 | (:~ |
1296 | 1208 | : Borrowed from excel module.<br/> | 1182 | : Returns the rank of a number in a list of numbers. <p/> |
1295 | 1209 | : Returns the rank of a number in a list of numbers. | ||
1297 | 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. |
1298 | 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.) |
1300 | 1212 | : RANK gives duplicate numbers the same rank. | 1185 | : RANK gives duplicate numbers the same rank.<p/> |
1301 | 1186 | : Borrowed from excel module. | ||
1302 | 1213 | : | 1187 | : |
1303 | 1214 | : @see http://office.microsoft.com/en-us/excel/HP052092311033.aspx | 1188 | : @see http://office.microsoft.com/en-us/excel/HP052092311033.aspx |
1304 | 1215 | : @param $x The number whose rank you want to find. | 1189 | : @param $x The number whose rank you want to find. |
1305 | @@ -1224,9 +1198,9 @@ | |||
1306 | 1224 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq | 1198 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq |
1307 | 1225 | :) | 1199 | :) |
1308 | 1226 | declare function math:rank( | 1200 | declare function math:rank( |
1312 | 1227 | $x as xs:double, | 1201 | $x as double, |
1313 | 1228 | $numbers as xs:double*, | 1202 | $numbers as double*, |
1314 | 1229 | $order_ascending as xs:boolean) as xs:double | 1203 | $order_ascending as boolean) as double |
1315 | 1230 | { | 1204 | { |
1316 | 1231 | let $ordered_numbers := | 1205 | let $ordered_numbers := |
1317 | 1232 | if ($order_ascending) then ( | 1206 | if ($order_ascending) then ( |
1318 | @@ -1244,12 +1218,12 @@ | |||
1319 | 1244 | let $rank := | 1218 | let $rank := |
1320 | 1245 | ( | 1219 | ( |
1321 | 1246 | for $i at $pos in $ordered_numbers | 1220 | for $i at $pos in $ordered_numbers |
1324 | 1247 | where $xnum = $i or $order_ascending and $xnum < $i | 1221 | where $xnum eq $i or $order_ascending and $xnum lt $i |
1325 | 1248 | or fn:not($order_ascending) and $xnum > $i | 1222 | or fn:not($order_ascending) and $xnum gt $i |
1326 | 1249 | return | 1223 | return |
1328 | 1250 | if ($xnum = $i) then | 1224 | if ($xnum eq $i) then |
1329 | 1251 | $pos | 1225 | $pos |
1331 | 1252 | else if ($pos = 1) then | 1226 | else if ($pos eq 1) then |
1332 | 1253 | 0 | 1227 | 0 |
1333 | 1254 | else | 1228 | else |
1334 | 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]) |
1335 | @@ -1262,8 +1236,8 @@ | |||
1336 | 1262 | }; | 1236 | }; |
1337 | 1263 | 1237 | ||
1338 | 1264 | (:~ | 1238 | (:~ |
1341 | 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/> |
1342 | 1266 | : This RANK function is same as the above, only that $order_ascending is set by default to false. | 1240 | : Borrowed from excel module. |
1343 | 1267 | : | 1241 | : |
1344 | 1268 | : @see http://office.microsoft.com/en-us/excel/HP052092311033.aspx | 1242 | : @see http://office.microsoft.com/en-us/excel/HP052092311033.aspx |
1345 | 1269 | : @param $x The number whose rank you want to find. | 1243 | : @param $x The number whose rank you want to find. |
1346 | @@ -1274,46 +1248,45 @@ | |||
1347 | 1274 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq | 1248 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq |
1348 | 1275 | :) | 1249 | :) |
1349 | 1276 | declare function math:rank( | 1250 | declare function math:rank( |
1352 | 1277 | $x as xs:double, | 1251 | $x as double, |
1353 | 1278 | $numbers as xs:double*) as xs:double | 1252 | $numbers as double*) as double |
1354 | 1279 | { | 1253 | { |
1356 | 1280 | math:rank($x, $numbers, fn:false()) | 1254 | math:rank($x, $numbers, false) |
1357 | 1281 | }; | 1255 | }; |
1358 | 1282 | 1256 | ||
1359 | 1283 | (:~ | 1257 | (:~ |
1362 | 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/> |
1361 | 1285 | : Returns the rank of a value in a data set as a percentage of the data set. | ||
1363 | 1286 | : If x does not match one of the values in array, | 1259 | : If x does not match one of the values in array, |
1364 | 1287 | : PERCENTRANK interpolates to return the correct percentage rank. <br/> | 1260 | : PERCENTRANK interpolates to return the correct percentage rank. <br/> |
1367 | 1288 | : The formula is uses: (RANK - 1) / (size - 1) . | 1261 | : The formula is uses: (RANK - 1) / (size - 1) .<p/> |
1368 | 1289 | : | 1262 | : Borrowed from excel module. |
1369 | 1290 | : @see http://office.microsoft.com/en-us/excel/HP052092121033.aspx | 1263 | : @see http://office.microsoft.com/en-us/excel/HP052092121033.aspx |
1370 | 1291 | : @param $numbers the sequence of numbers. | 1264 | : @param $numbers the sequence of numbers. |
1371 | 1292 | : The sequence can be of any length, from 1 up. | 1265 | : The sequence can be of any length, from 1 up. |
1372 | 1293 | : @param $x is the value for which you want to know the rank | 1266 | : @param $x is the value for which you want to know the rank |
1373 | 1294 | : @return The percentage of rank. | 1267 | : @return The percentage of rank. |
1375 | 1295 | : @error math:errNum if the sequence is zero length | 1268 | : @error math:INVALID_ARGUMENT if the sequence is zero length |
1376 | 1296 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq | 1269 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq |
1377 | 1297 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq | 1270 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq |
1378 | 1298 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq | 1271 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq |
1379 | 1299 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq | 1272 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq |
1380 | 1300 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq | 1273 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq |
1381 | 1301 | :) | 1274 | :) |
1383 | 1302 | declare function math:percentrank($numbers as xs:double*, $x as xs:double) as xs:double | 1275 | declare function math:percentrank($numbers as double*, $x as double) as double |
1384 | 1303 | { | 1276 | { |
1385 | 1304 | if (fn:empty($numbers)) then | 1277 | if (fn:empty($numbers)) then |
1387 | 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") |
1388 | 1306 | else | 1279 | else |
1391 | 1307 | let $rank := math:rank($x, $numbers, fn:true()) return | 1280 | let $rank := math:rank($x, $numbers, true) return |
1392 | 1308 | if ($rank = 0) then | 1281 | if ($rank eq 0) then |
1393 | 1309 | 0 | 1282 | 0 |
1394 | 1310 | else | 1283 | else |
1395 | 1311 | ($rank - 1) div (fn:count($numbers) - 1) | 1284 | ($rank - 1) div (fn:count($numbers) - 1) |
1396 | 1312 | }; | 1285 | }; |
1397 | 1313 | 1286 | ||
1398 | 1314 | (:~ | 1287 | (:~ |
1401 | 1315 | : Borrowed from excel module.<br/> | 1288 | : Returns the quartile of a data set. <p/> |
1402 | 1316 | : Returns the quartile of a data set. | 1289 | : Borrowed from excel module. |
1403 | 1317 | : | 1290 | : |
1404 | 1318 | : @see http://office.microsoft.com/en-us/excel/HP052092261033.aspx | 1291 | : @see http://office.microsoft.com/en-us/excel/HP052092261033.aspx |
1405 | 1319 | : @param $numbers sequence of numbers. | 1292 | : @param $numbers sequence of numbers. |
1406 | @@ -1325,50 +1298,50 @@ | |||
1407 | 1325 | : <dt>3</dt> <dd> compute third quartile (75th percentile)</dd> | 1298 | : <dt>3</dt> <dd> compute third quartile (75th percentile)</dd> |
1408 | 1326 | : <dt>4</dt> <dd> compute maximum value</dd></dl> | 1299 | : <dt>4</dt> <dd> compute maximum value</dd></dl> |
1409 | 1327 | : @return the computed quartile, as numeric type | 1300 | : @return the computed quartile, as numeric type |
1411 | 1328 | : @error math:errNum if the sequence is zero length or $quart is not one of the values 0,1,3,4 | 1301 | : @error math:INVALID_ARGUMENT if the sequence is zero length or $quart is not one of the values 0,1,3,4 |
1412 | 1329 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq | 1302 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq |
1413 | 1330 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq | 1303 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq |
1414 | 1331 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq | 1304 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq |
1415 | 1332 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq | 1305 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq |
1416 | 1333 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq | 1306 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq |
1417 | 1334 | :) | 1307 | :) |
1419 | 1335 | declare function math:quartile($numbers as xs:double*, $quart as xs:integer) as xs:double | 1308 | declare function math:quartile($numbers as double*, $quart as integer) as double |
1420 | 1336 | { | 1309 | { |
1421 | 1337 | if (fn:empty($numbers)) then | 1310 | if (fn:empty($numbers)) then |
1423 | 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") |
1424 | 1339 | else | 1312 | else |
1426 | 1340 | if ($quart = 0) then | 1313 | if ($quart eq 0) then |
1427 | 1341 | fn:min($numbers) | 1314 | fn:min($numbers) |
1428 | 1342 | else | 1315 | else |
1430 | 1343 | if ($quart = 1) then | 1316 | if ($quart eq 1) then |
1431 | 1344 | let $r := (fn:count($numbers) + 3) div 4 | 1317 | let $r := (fn:count($numbers) + 3) div 4 |
1433 | 1345 | let $rint := xs:integer($r) | 1318 | let $rint := integer($r) |
1434 | 1346 | let $rrem := $r - $rint | 1319 | let $rrem := $r - $rint |
1435 | 1347 | let $sorted_numbers := math:sort-numbers( $numbers ) return | 1320 | let $sorted_numbers := math:sort-numbers( $numbers ) return |
1436 | 1348 | ($numbers[$rint + 1] - $numbers[$rint]) * $rrem + $numbers[$rint] | 1321 | ($numbers[$rint + 1] - $numbers[$rint]) * $rrem + $numbers[$rint] |
1437 | 1349 | else | 1322 | else |
1439 | 1350 | if ($quart = 2) then | 1323 | if ($quart eq 2) then |
1440 | 1351 | math:median($numbers) | 1324 | math:median($numbers) |
1441 | 1352 | else | 1325 | else |
1443 | 1353 | if ($quart = 3) then | 1326 | if ($quart eq 3) then |
1444 | 1354 | let $r := (3 * fn:count($numbers) + 1) div 4 | 1327 | let $r := (3 * fn:count($numbers) + 1) div 4 |
1446 | 1355 | let $rint := xs:integer($r) | 1328 | let $rint := integer($r) |
1447 | 1356 | let $rrem := $r - $rint | 1329 | let $rrem := $r - $rint |
1448 | 1357 | let $sorted_numbers := math:sort-numbers( $numbers ) return | 1330 | let $sorted_numbers := math:sort-numbers( $numbers ) return |
1449 | 1358 | ($numbers[$rint + 1] - $numbers[$rint]) * $rrem + $numbers[$rint] | 1331 | ($numbers[$rint + 1] - $numbers[$rint]) * $rrem + $numbers[$rint] |
1450 | 1359 | else | 1332 | else |
1452 | 1360 | if ($quart = 4) then | 1333 | if ($quart eq 4) then |
1453 | 1361 | fn:max($numbers) | 1334 | fn:max($numbers) |
1454 | 1362 | else | 1335 | else |
1456 | 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) |
1457 | 1364 | }; | 1337 | }; |
1458 | 1365 | 1338 | ||
1459 | 1366 | (:~ | 1339 | (:~ |
1462 | 1367 | : Borrowed from excel module.<br/> | 1340 | : This function computes the k-th smallest value in a data set. <p/> |
1461 | 1368 | : This function computes the k-th smallest value in a data set. | ||
1463 | 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. |
1464 | 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, |
1465 | 1371 | : and SMALL(array,n) equals the largest value. | 1343 | : and SMALL(array,n) equals the largest value. |
1466 | 1344 | : Borrowed from excel module. | ||
1467 | 1372 | : | 1345 | : |
1468 | 1373 | : @see http://office.microsoft.com/en-us/excel/HP052092661033.aspx | 1346 | : @see http://office.microsoft.com/en-us/excel/HP052092661033.aspx |
1469 | 1374 | : @param $numbers A sequence of numbers. | 1347 | : @param $numbers A sequence of numbers. |
1470 | @@ -1376,17 +1349,17 @@ | |||
1471 | 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. |
1472 | 1377 | : Must have value between 1 and size of sequence. | 1350 | : Must have value between 1 and size of sequence. |
1473 | 1378 | : @return The k-th smallest value of $numbers. | 1351 | : @return The k-th smallest value of $numbers. |
1475 | 1379 | : @error math:errNum if the sequence is zero length or $k is not a value | 1352 | : @error math:INVALID_ARGUMENT if the sequence is zero length or $k is not a value |
1476 | 1380 | : between 1 and the size of sequence. | 1353 | : between 1 and the size of sequence. |
1477 | 1381 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq | 1354 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq |
1478 | 1382 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq | 1355 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq |
1479 | 1383 | :) | 1356 | :) |
1481 | 1384 | declare function math:small($numbers as xs:double*, $k as xs:integer) as xs:double | 1357 | declare function math:small($numbers as double*, $k as integer) as double |
1482 | 1385 | { | 1358 | { |
1483 | 1386 | if (fn:empty($numbers)) then | 1359 | if (fn:empty($numbers)) then |
1485 | 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") |
1486 | 1388 | else if ($k gt fn:count($numbers) or $k le 0) then | 1361 | else if ($k gt fn:count($numbers) or $k le 0) then |
1488 | 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) |
1489 | 1390 | else | 1363 | else |
1490 | 1391 | let $ordered_numbers := ( | 1364 | let $ordered_numbers := ( |
1491 | 1392 | for $n in $numbers | 1365 | for $n in $numbers |
1492 | @@ -1400,17 +1373,16 @@ | |||
1493 | 1400 | 1373 | ||
1494 | 1401 | 1374 | ||
1495 | 1402 | (:~ | 1375 | (:~ |
1500 | 1403 | : Borrowed from excel module.<br/> | 1376 | : Function for VAR, VARA, VARP, VARPA and SLOPE.<p/> |
1501 | 1404 | : Function for VAR, VARA, VARP, VARPA and SLOPE. | 1377 | : It computes formula sum((x - average_x)^2) for all x in $numbers.<p/> |
1502 | 1405 | : This function should not be used outside this module. | 1378 | : Borrowed from excel module. |
1499 | 1406 | : It computes formula sum((x - average_x)^2) for all x in $numbers. | ||
1503 | 1407 | : | 1379 | : |
1504 | 1408 | : @param $numbers the sequence of numbers. | 1380 | : @param $numbers the sequence of numbers. |
1505 | 1409 | : The sequence can be of any length. | 1381 | : The sequence can be of any length. |
1506 | 1410 | : @param $average The precomputed average over the sequence. | 1382 | : @param $average The precomputed average over the sequence. |
1507 | 1411 | : @return The result as numeric type. | 1383 | : @return The result as numeric type. |
1508 | 1412 | :) | 1384 | :) |
1510 | 1413 | declare %private function math:sumsq-deviations($numbers as xs:double*, $average as xs:double) as xs:double | 1385 | declare %private function math:sumsq-deviations($numbers as double*, $average as double) as double |
1511 | 1414 | { | 1386 | { |
1512 | 1415 | if (fn:empty($numbers)) then | 1387 | if (fn:empty($numbers)) then |
1513 | 1416 | 0 | 1388 | 0 |
1514 | @@ -1421,11 +1393,11 @@ | |||
1515 | 1421 | }; | 1393 | }; |
1516 | 1422 | 1394 | ||
1517 | 1423 | (:~ | 1395 | (:~ |
1523 | 1424 | : Borrowed from excel module.<br/> | 1396 | : Estimates variance based on a sample.<p/> |
1524 | 1425 | : Estimates variance based on a sample.<br/> | 1397 | : The formula is sum(x - average_x)^2 / (n - 1). |
1525 | 1426 | : The formula is sum(x - average_x)^2 / (n - 1).<br/> | 1398 | : average_x is computed with AVERAGE function. |
1526 | 1427 | : average_x is computed with AVERAGE function.<br/> | 1399 | : n is the count of numbers from the sequence, excluding empty values.<p/> |
1527 | 1428 | : n is the count of numbers from the sequence, excluding empty values. | 1400 | : Borrowed from excel module. |
1528 | 1429 | : | 1401 | : |
1529 | 1430 | : @see http://office.microsoft.com/en-us/excel/HP052093301033.aspx | 1402 | : @see http://office.microsoft.com/en-us/excel/HP052093301033.aspx |
1530 | 1431 | : @param $numbers the sequence of numbers. | 1403 | : @param $numbers the sequence of numbers. |
1531 | @@ -1433,7 +1405,7 @@ | |||
1532 | 1433 | : @return The variance, as numeric type | 1405 | : @return The variance, as numeric type |
1533 | 1434 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq | 1406 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq |
1534 | 1435 | :) | 1407 | :) |
1536 | 1436 | declare function math:var($numbers as xs:double+) as xs:double | 1408 | declare function math:var($numbers as double+) as double |
1537 | 1437 | { | 1409 | { |
1538 | 1438 | let $average := fn:avg($numbers) | 1410 | let $average := fn:avg($numbers) |
1539 | 1439 | return | 1411 | return |
1540 | @@ -1441,11 +1413,11 @@ | |||
1541 | 1441 | }; | 1413 | }; |
1542 | 1442 | 1414 | ||
1543 | 1443 | (:~ | 1415 | (:~ |
1549 | 1444 | : Borrowed from excel module.<br/> | 1416 | : Estimates variance based on a sample.<p/> |
1550 | 1445 | : Estimates variance based on a sample.<br/> | 1417 | : The formula is sum(x - average_x)^2 / (n - 1). |
1551 | 1446 | : The formula is sum(x - average_x)^2 / (n - 1).<br/> | 1418 | : average_x is computed with AVERAGE function. |
1552 | 1447 | : average_x is computed with AVERAGE function.<br/> | 1419 | : n is the size of sequence, including empty values.<p/> |
1553 | 1448 | : n is the size of sequence, including empty values.<br/> | 1420 | : Borrowed from excel module. |
1554 | 1449 | : | 1421 | : |
1555 | 1450 | : @see http://office.microsoft.com/en-us/excel/HP052093311033.aspx | 1422 | : @see http://office.microsoft.com/en-us/excel/HP052093311033.aspx |
1556 | 1451 | : @param $numbers the sequence of numbers. | 1423 | : @param $numbers the sequence of numbers. |
1557 | @@ -1453,18 +1425,18 @@ | |||
1558 | 1453 | : @return The variance, as numeric type | 1425 | : @return The variance, as numeric type |
1559 | 1454 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq | 1426 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq |
1560 | 1455 | :) | 1427 | :) |
1562 | 1456 | declare function math:vara($numbers as xs:double+) as xs:double | 1428 | declare function math:vara($numbers as double+) as double |
1563 | 1457 | { | 1429 | { |
1564 | 1458 | let $average := fn:avg($numbers) return | 1430 | let $average := fn:avg($numbers) return |
1565 | 1459 | math:sumsq-deviations($numbers, $average) div (fn:count($numbers) - 1) | 1431 | math:sumsq-deviations($numbers, $average) div (fn:count($numbers) - 1) |
1566 | 1460 | }; | 1432 | }; |
1567 | 1461 | 1433 | ||
1568 | 1462 | (:~ | 1434 | (:~ |
1569 | 1435 | : Calculates variance based on the entire population.<p/> | ||
1570 | 1436 | : The formula is sum(x - average_x)^2 / n. | ||
1571 | 1437 | : average_x is computed with AVERAGE function. | ||
1572 | 1438 | : n is the count of numbers from the sequence, excluding empty values.<p/> | ||
1573 | 1463 | : Borrowed from excel module.<br/> | 1439 | : Borrowed from excel module.<br/> |
1574 | 1464 | : Calculates variance based on the entire population.<br/> | ||
1575 | 1465 | : The formula is sum(x - average_x)^2 / n.<br/> | ||
1576 | 1466 | : average_x is computed with AVERAGE function.<br/> | ||
1577 | 1467 | : n is the count of numbers from the sequence, excluding empty values.<br/> | ||
1578 | 1468 | : | 1440 | : |
1579 | 1469 | : @see http://office.microsoft.com/en-us/excel/HP052093321033.aspx | 1441 | : @see http://office.microsoft.com/en-us/excel/HP052093321033.aspx |
1580 | 1470 | : @param $numbers the sequence of numbers. | 1442 | : @param $numbers the sequence of numbers. |
1581 | @@ -1472,18 +1444,18 @@ | |||
1582 | 1472 | : @return The variance, as numeric type | 1444 | : @return The variance, as numeric type |
1583 | 1473 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq | 1445 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq |
1584 | 1474 | :) | 1446 | :) |
1586 | 1475 | declare function math:varp($numbers as xs:double+) as xs:double | 1447 | declare function math:varp($numbers as double+) as double |
1587 | 1476 | { | 1448 | { |
1588 | 1477 | let $average := fn:avg($numbers) return | 1449 | let $average := fn:avg($numbers) return |
1589 | 1478 | math:sumsq-deviations($numbers, $average) div fn:count($numbers) | 1450 | math:sumsq-deviations($numbers, $average) div fn:count($numbers) |
1590 | 1479 | }; | 1451 | }; |
1591 | 1480 | 1452 | ||
1592 | 1481 | (:~ | 1453 | (:~ |
1598 | 1482 | : Borrowed from excel module.<br/> | 1454 | : Calculates variance based on the entire population.<p/> |
1599 | 1483 | : Calculates variance based on the entire population.<br/> | 1455 | : The formula is sum(x - average_x)^2 / n. |
1600 | 1484 | : The formula is sum(x - average_x)^2 / n.<br/> | 1456 | : average_x is computed with AVERAGE function. |
1601 | 1485 | : average_x is computed with AVERAGE function.<br/> | 1457 | : n is the size of sequence, including empty values.<p/> |
1602 | 1486 | : n is the size of sequence, including empty values.<br/> | 1458 | : Borrowed from excel module. |
1603 | 1487 | : | 1459 | : |
1604 | 1488 | : @see http://office.microsoft.com/en-us/excel/HP052093321033.aspx | 1460 | : @see http://office.microsoft.com/en-us/excel/HP052093321033.aspx |
1605 | 1489 | : @param $numbers the sequence of numbers. | 1461 | : @param $numbers the sequence of numbers. |
1606 | @@ -1491,61 +1463,58 @@ | |||
1607 | 1491 | : @return The variance, as numeric type | 1463 | : @return The variance, as numeric type |
1608 | 1492 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq | 1464 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq |
1609 | 1493 | :) | 1465 | :) |
1611 | 1494 | declare function math:varpa($numbers as xs:double+) as xs:double | 1466 | declare function math:varpa($numbers as double+) as double |
1612 | 1495 | { | 1467 | { |
1613 | 1496 | let $average := fn:avg($numbers) return | 1468 | let $average := fn:avg($numbers) return |
1614 | 1497 | math:sumsq-deviations($numbers, $average) div fn:count($numbers) | 1469 | math:sumsq-deviations($numbers, $average) div fn:count($numbers) |
1615 | 1498 | }; | 1470 | }; |
1616 | 1499 | 1471 | ||
1617 | 1500 | (:~ | 1472 | (:~ |
1621 | 1501 | : Borrowed from excel module.<br/> | 1473 | : Function for PROB function.<p/> |
1619 | 1502 | : Function for PROB function. | ||
1620 | 1503 | : This function should not be used outside this module. | ||
1622 | 1504 | : Computes the sum over a sequence of numbers. | 1474 | : Computes the sum over a sequence of numbers. |
1624 | 1505 | : Checks if the values are between 0 and 1. | 1475 | : Checks if the values are between 0 and 1.<p/> |
1625 | 1476 | : Borrowed from excel module. | ||
1626 | 1506 | : | 1477 | : |
1627 | 1507 | : @param $prob_range The sequence of probabilities. | 1478 | : @param $prob_range The sequence of probabilities. |
1628 | 1508 | : @return The sum of probabilities. This should be 1. | 1479 | : @return The sum of probabilities. This should be 1. |
1631 | 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. |
1630 | 1510 | : @error math:errValue if any parameter is not castable to numeric. | ||
1632 | 1511 | :) | 1481 | :) |
1634 | 1512 | declare %private function math:sum-prob($prob_range as xs:double*) as xs:double | 1482 | declare %private function math:sum-prob($prob_range as double*) as double |
1635 | 1513 | { | 1483 | { |
1636 | 1514 | if (fn:empty($prob_range)) then | 1484 | if (fn:empty($prob_range)) then |
1637 | 1515 | 0 | 1485 | 0 |
1638 | 1516 | else | 1486 | else |
1639 | 1517 | let $prob_num := $prob_range[1] | 1487 | let $prob_num := $prob_range[1] |
1640 | 1518 | return | 1488 | return |
1643 | 1519 | if ($prob_num < 0 or $prob_num > 1) then | 1489 | if ($prob_num lt 0 or $prob_num gt 1) then |
1644 | 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) |
1645 | 1521 | else | 1491 | else |
1646 | 1522 | $prob_num + math:sum-prob(fn:subsequence($prob_range, 2)) | 1492 | $prob_num + math:sum-prob(fn:subsequence($prob_range, 2)) |
1647 | 1523 | }; | 1493 | }; |
1648 | 1524 | 1494 | ||
1649 | 1525 | (:~ | 1495 | (:~ |
1653 | 1526 | : Borrowed from excel module.<br/> | 1496 | : Function for PROB function.<p/> |
1651 | 1527 | : Function for PROB function. | ||
1652 | 1528 | : This function should not be used outside this module. | ||
1654 | 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. |
1656 | 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/> |
1657 | 1499 | : Borrowed from excel module. | ||
1658 | 1531 | : | 1500 | : |
1659 | 1532 | : @param $x_range The sequence of x values. | 1501 | : @param $x_range The sequence of x values. |
1660 | 1533 | : @param $prob_range The sequence of probabilities associated to x values. | 1502 | : @param $prob_range The sequence of probabilities associated to x values. |
1661 | 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. |
1662 | 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. |
1663 | 1536 | : @return The sum of probabilities. | 1505 | : @return The sum of probabilities. |
1665 | 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. |
1666 | 1538 | :) | 1507 | :) |
1667 | 1539 | declare %private function math:sum-prob-x( | 1508 | declare %private function math:sum-prob-x( |
1672 | 1540 | $x_range as xs:double*, | 1509 | $x_range as double*, |
1673 | 1541 | $prob_range as xs:double*, | 1510 | $prob_range as double*, |
1674 | 1542 | $range_lower_limit as xs:double, | 1511 | $range_lower_limit as double, |
1675 | 1543 | $upper_limit as xs:double) as xs:double | 1512 | $upper_limit as double) as double |
1676 | 1544 | { | 1513 | { |
1677 | 1545 | if (fn:empty($x_range) and fn:not(fn:empty($prob_range))) then | 1514 | if (fn:empty($x_range) and fn:not(fn:empty($prob_range))) then |
1679 | 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") |
1680 | 1547 | else if (fn:empty($prob_range) and fn:not(fn:empty($x_range))) then | 1516 | else if (fn:empty($prob_range) and fn:not(fn:empty($x_range))) then |
1682 | 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") |
1683 | 1549 | else if (fn:empty($prob_range) and fn:empty($x_range)) then | 1518 | else if (fn:empty($prob_range) and fn:empty($x_range)) then |
1684 | 1550 | 0 | 1519 | 0 |
1685 | 1551 | else | 1520 | else |
1686 | @@ -1564,9 +1533,9 @@ | |||
1687 | 1564 | }; | 1533 | }; |
1688 | 1565 | 1534 | ||
1689 | 1566 | (:~ | 1535 | (:~ |
1693 | 1567 | : Borrowed from excel module.<br/> | 1536 | : Returns the probability that values in a range are between two limits.<p/> |
1694 | 1568 | : Returns the probability that values in a range are between two limits. | 1537 | : Borrowed from excel module. |
1695 | 1569 | : | 1538 | : |
1696 | 1570 | : @see http://office.microsoft.com/en-us/excel/HP052092221033.aspx | 1539 | : @see http://office.microsoft.com/en-us/excel/HP052092221033.aspx |
1697 | 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. |
1698 | 1572 | : This does not need to be ordered. | 1541 | : This does not need to be ordered. |
1699 | @@ -1574,19 +1543,19 @@ | |||
1700 | 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. |
1701 | 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. |
1702 | 1576 | : @return The probability of the entire range | 1545 | : @return The probability of the entire range |
1706 | 1577 | : @error math:errNum if any probability is not between 0 and 1 | 1546 | : @error math:INVALID_ARGUMENT if any probability is not between 0 and 1 |
1707 | 1578 | : @error math:errNum if the sum of probabilities is not equal to 1 | 1547 | : @error math:INVALID_ARGUMENT if the sum of probabilities is not equal to 1 |
1708 | 1579 | : @error math:errNum if x_range and prob_range do not have the same number of values | 1548 | : @error math:INVALID_ARGUMENT if x_range and prob_range do not have the same number of values |
1709 | 1580 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq | 1549 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq |
1710 | 1581 | :) | 1550 | :) |
1715 | 1582 | declare function math:prob($x_range as xs:double+, | 1551 | declare function math:prob($x_range as double+, |
1716 | 1583 | $prob_range as xs:double+, | 1552 | $prob_range as double+, |
1717 | 1584 | $range_lower_limit as xs:double, | 1553 | $range_lower_limit as double, |
1718 | 1585 | $upper_limit as xs:double) as xs:double | 1554 | $upper_limit as double) as double |
1719 | 1586 | { | 1555 | { |
1720 | 1587 | let $prob_sum := math:sum-prob($prob_range) return | 1556 | let $prob_sum := math:sum-prob($prob_range) return |
1723 | 1588 | if ($prob_sum != 1) then | 1557 | if ($prob_sum ne 1) then |
1724 | 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") |
1725 | 1590 | else | 1559 | else |
1726 | 1591 | math:sum-prob-x($x_range, $prob_range, | 1560 | math:sum-prob-x($x_range, $prob_range, |
1727 | 1592 | $range_lower_limit, | 1561 | $range_lower_limit, |
1728 | @@ -1594,9 +1563,9 @@ | |||
1729 | 1594 | }; | 1563 | }; |
1730 | 1595 | 1564 | ||
1731 | 1596 | (:~ | 1565 | (:~ |
1735 | 1597 | : Borrowed from excel module.<br/> | 1566 | : This is the same as math:prob#4, only that upper_limit is not specified.<p/> |
1736 | 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/> |
1737 | 1599 | : The probability is computed only for range_lower_limit. | 1568 | : Borrowed from excel module. |
1738 | 1600 | : | 1569 | : |
1739 | 1601 | : @see http://office.microsoft.com/en-us/excel/HP052092221033.aspx | 1570 | : @see http://office.microsoft.com/en-us/excel/HP052092221033.aspx |
1740 | 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. |
1741 | @@ -1604,43 +1573,42 @@ | |||
1742 | 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. |
1743 | 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. |
1744 | 1606 | : @return The probability of the range_lower_limit value | 1575 | : @return The probability of the range_lower_limit value |
1748 | 1607 | : @error math:errNum if any probability is not between 0 and 1 | 1576 | : @error math:INVALID_ARGUMENT if any probability is not between 0 and 1 |
1749 | 1608 | : @error math:errNum if the sum of probabilities is not equal to 1 | 1577 | : @error math:INVALID_ARGUMENT if the sum of probabilities is not equal to 1 |
1750 | 1609 | : @error math:errNum if x_range and prob_range do not have the same number of values | 1578 | : @error math:INVALID_ARGUMENT if x_range and prob_range do not have the same number of values |
1751 | 1610 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq | 1579 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq |
1752 | 1611 | :) | 1580 | :) |
1756 | 1612 | declare function math:prob($x_range as xs:double+, | 1581 | declare function math:prob($x_range as double+, |
1757 | 1613 | $prob_range as xs:double+, | 1582 | $prob_range as double+, |
1758 | 1614 | $range_lower_limit as xs:double) as xs:double | 1583 | $range_lower_limit as double) as double |
1759 | 1615 | { | 1584 | { |
1760 | 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) |
1761 | 1617 | }; | 1586 | }; |
1762 | 1618 | 1587 | ||
1763 | 1619 | (:~ | 1588 | (:~ |
1770 | 1620 | : Borrowed from excel module.<br/> | 1589 | : Function for SLOPE function.<p/> |
1771 | 1621 | : Function for SLOPE function. | 1590 | : It computes the formula:<p/> |
1772 | 1622 | : This function should not be used outside this module. | 1591 | : sum((x - average_x)(y - average_y))<p/> |
1773 | 1623 | : It computes the formula:<br/> | 1592 | : where average_x and average_y are computed with AVERAGE function.<p/> |
1774 | 1624 | : sum((x - average_x)(y - average_y)) <br/> | 1593 | : Borrowed from excel module. |
1769 | 1625 | : where average_x and average_y are computed with AVERAGE function. | ||
1775 | 1626 | : | 1594 | : |
1776 | 1627 | : @param $x_numbers The sequence of x numbers. | 1595 | : @param $x_numbers The sequence of x numbers. |
1777 | 1628 | : @param $x_average The precomputed AVERAGE over the x_numbers. | 1596 | : @param $x_average The precomputed AVERAGE over the x_numbers. |
1778 | 1629 | : @param $y_numbers The sequence of y numbers. | 1597 | : @param $y_numbers The sequence of y numbers. |
1779 | 1630 | : @param $y_average The precomputed AVERAGE over the y_numbers. | 1598 | : @param $y_average The precomputed AVERAGE over the y_numbers. |
1780 | 1631 | : @return The formula result, as numeric type. | 1599 | : @return The formula result, as numeric type. |
1782 | 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. |
1783 | 1633 | :) | 1601 | :) |
1784 | 1634 | declare %private function math:sum-x-y-deviations( | 1602 | declare %private function math:sum-x-y-deviations( |
1789 | 1635 | $x_numbers as xs:double*, | 1603 | $x_numbers as double*, |
1790 | 1636 | $x_average as xs:double, | 1604 | $x_average as double, |
1791 | 1637 | $y_numbers as xs:double*, | 1605 | $y_numbers as double*, |
1792 | 1638 | $y_average as xs:double) as xs:double | 1606 | $y_average as double) as double |
1793 | 1639 | { | 1607 | { |
1794 | 1640 | if (fn:empty($x_numbers) and fn:not(fn:empty($y_numbers))) then | 1608 | if (fn:empty($x_numbers) and fn:not(fn:empty($y_numbers))) then |
1796 | 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") |
1797 | 1642 | else if (fn:empty($y_numbers) and fn:not(fn:empty($x_numbers))) then | 1610 | else if (fn:empty($y_numbers) and fn:not(fn:empty($x_numbers))) then |
1799 | 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") |
1800 | 1644 | else if (fn:empty($x_numbers) and fn:empty($y_numbers)) then | 1612 | else if (fn:empty($x_numbers) and fn:empty($y_numbers)) then |
1801 | 1645 | 0 | 1613 | 0 |
1802 | 1646 | else | 1614 | else |
1803 | @@ -1652,13 +1620,13 @@ | |||
1804 | 1652 | }; | 1620 | }; |
1805 | 1653 | 1621 | ||
1806 | 1654 | (:~ | 1622 | (:~ |
1809 | 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/> |
1808 | 1656 | : Returns the slope of the linear regression line through data points in known_y's and known_x's. | ||
1810 | 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 |
1811 | 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. |
1815 | 1659 | : It computes the formula:<br/> | 1626 | : It computes the formula:<p/> |
1816 | 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/> |
1817 | 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/> |
1818 | 1629 | : Borrowed from excel module. | ||
1819 | 1662 | : | 1630 | : |
1820 | 1663 | : @see http://office.microsoft.com/en-us/excel/HP052092641033.aspx | 1631 | : @see http://office.microsoft.com/en-us/excel/HP052092641033.aspx |
1821 | 1664 | : @param $known_y the sequence of y numbers. | 1632 | : @param $known_y the sequence of y numbers. |
1822 | @@ -1666,57 +1634,57 @@ | |||
1823 | 1666 | : @param $known_x the sequence of x numbers. | 1634 | : @param $known_x the sequence of x numbers. |
1824 | 1667 | : The sequence can be of any length, from 1 up. | 1635 | : The sequence can be of any length, from 1 up. |
1825 | 1668 | : @return The slope value, as numeric type | 1636 | : @return The slope value, as numeric type |
1828 | 1669 | : @error math:errNA if there are different numbers of x's and y's or if the sequence is empty | 1637 | : @error math:INVALID_INPUT if there are different numbers of x's and y's or if the sequence is empty |
1829 | 1670 | : @error math:errDiv0 if all x's are equal | 1638 | : @error math:DIVIDE_BY_0 if all x's are equal |
1830 | 1671 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq | 1639 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq |
1831 | 1672 | :) | 1640 | :) |
1834 | 1673 | declare function math:slope($known_y as xs:double+, | 1641 | declare function math:slope($known_y as double+, |
1835 | 1674 | $known_x as xs:double+) as xs:double | 1642 | $known_x as double+) as double |
1836 | 1675 | { | 1643 | { |
1837 | 1676 | if (fn:empty($known_y) or fn:empty($known_x)) then | 1644 | if (fn:empty($known_y) or fn:empty($known_x)) then |
1839 | 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") |
1840 | 1678 | else | 1646 | else |
1841 | 1679 | let $x_average := fn:avg($known_x) | 1647 | let $x_average := fn:avg($known_x) |
1842 | 1680 | let $y_average := fn:avg($known_y) | 1648 | let $y_average := fn:avg($known_y) |
1843 | 1681 | let $xsq_dev := math:sumsq-deviations($known_x, $x_average) return | 1649 | let $xsq_dev := math:sumsq-deviations($known_x, $x_average) return |
1846 | 1682 | if ($xsq_dev = 0) then | 1650 | if ($xsq_dev eq 0) then |
1847 | 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") |
1848 | 1684 | else | 1652 | else |
1849 | 1685 | let $x_y_dev := math:sum-x-y-deviations($known_x, $x_average, $known_y, $y_average) return | 1653 | let $x_y_dev := math:sum-x-y-deviations($known_x, $x_average, $known_y, $y_average) return |
1850 | 1686 | $x_y_dev div $xsq_dev | 1654 | $x_y_dev div $xsq_dev |
1851 | 1687 | }; | 1655 | }; |
1852 | 1688 | 1656 | ||
1853 | 1689 | (:~ | 1657 | (:~ |
1857 | 1690 | : Borrowed from excel module.<br/> | 1658 | : Returns a normalized value from a distribution characterized by mean and standard_dev.<p/> |
1858 | 1691 | : Returns a normalized value from a distribution characterized by mean and standard_dev.<br/> | 1659 | : The formula is (x - mean) / standard_dev .<p/> |
1859 | 1692 | : The formula is (x - mean) / standard_dev . | 1660 | : Borrowed from excel module. |
1860 | 1693 | : | 1661 | : |
1861 | 1694 | : @see http://office.microsoft.com/en-us/excel/HP052092731033.aspx | 1662 | : @see http://office.microsoft.com/en-us/excel/HP052092731033.aspx |
1862 | 1695 | : @param $x is the value you want to normalize | 1663 | : @param $x is the value you want to normalize |
1863 | 1696 | : @param $mean is the arithmetic mean of the distribution. | 1664 | : @param $mean is the arithmetic mean of the distribution. |
1864 | 1697 | : @param $standard_dev is the standard deviation of the distribution. | 1665 | : @param $standard_dev is the standard deviation of the distribution. |
1865 | 1698 | : @return The normalized x, as numeric type | 1666 | : @return The normalized x, as numeric type |
1867 | 1699 | : @error math:errNum if standard_dev is a value smaller than zero or equal | 1667 | : @error math:INVALID_ARGUMENT if standard_dev is a value smaller than zero or equal |
1868 | 1700 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq | 1668 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq |
1869 | 1701 | :) | 1669 | :) |
1873 | 1702 | declare function math:standardize($x as xs:double, | 1670 | declare function math:standardize($x as double, |
1874 | 1703 | $mean as xs:double, | 1671 | $mean as double, |
1875 | 1704 | $standard_dev as xs:double) as xs:double | 1672 | $standard_dev as double) as double |
1876 | 1705 | { | 1673 | { |
1877 | 1706 | if ($standard_dev le 0) then | 1674 | if ($standard_dev le 0) then |
1879 | 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) |
1880 | 1708 | else | 1676 | else |
1881 | 1709 | ($x - $mean) div $standard_dev | 1677 | ($x - $mean) div $standard_dev |
1882 | 1710 | }; | 1678 | }; |
1883 | 1711 | 1679 | ||
1884 | 1712 | 1680 | ||
1885 | 1713 | (:~ | 1681 | (:~ |
1888 | 1714 | : Borrowed from excel module.<br/> | 1682 | : Estimates standard deviation based on a sample. <p/> |
1887 | 1715 | : Estimates standard deviation based on a sample. | ||
1889 | 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 |
1890 | 1717 | : from the average value (the mean). | 1684 | : from the average value (the mean). |
1891 | 1718 | : It is computed with formula: | 1685 | : It is computed with formula: |
1893 | 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/> |
1894 | 1687 | : Borrowed from excel module. | ||
1895 | 1720 | : | 1688 | : |
1896 | 1721 | : @see http://office.microsoft.com/en-us/excel/HP052092771033.aspx | 1689 | : @see http://office.microsoft.com/en-us/excel/HP052092771033.aspx |
1897 | 1722 | : @param $numbers the sequence of numbers | 1690 | : @param $numbers the sequence of numbers |
1898 | @@ -1724,18 +1692,18 @@ | |||
1899 | 1724 | : @return the standard deviation, as numeric type | 1692 | : @return the standard deviation, as numeric type |
1900 | 1725 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq | 1693 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq |
1901 | 1726 | :) | 1694 | :) |
1903 | 1727 | declare function math:stdev($numbers as xs:double+) as xs:double | 1695 | declare function math:stdev($numbers as double+) as double |
1904 | 1728 | { | 1696 | { |
1905 | 1729 | W3Cmath:sqrt(math:var($numbers)) | 1697 | W3Cmath:sqrt(math:var($numbers)) |
1906 | 1730 | }; | 1698 | }; |
1907 | 1731 | 1699 | ||
1908 | 1732 | (:~ | 1700 | (:~ |
1911 | 1733 | : Borrowed from excel module.<br/> | 1701 | : Estimates standard deviation based on a sample. <p/> |
1910 | 1734 | : Estimates standard deviation based on a sample. | ||
1912 | 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 |
1913 | 1736 | : from the average value (the mean). | 1703 | : from the average value (the mean). |
1914 | 1737 | : It is computed with formula: | 1704 | : It is computed with formula: |
1916 | 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/> |
1917 | 1706 | : Borrowed from excel module. | ||
1918 | 1739 | : | 1707 | : |
1919 | 1740 | : @see http://office.microsoft.com/en-us/excel/HP052092791033.aspx | 1708 | : @see http://office.microsoft.com/en-us/excel/HP052092791033.aspx |
1920 | 1741 | : @param $numbers the sequence of numbers. | 1709 | : @param $numbers the sequence of numbers. |
1921 | @@ -1743,18 +1711,18 @@ | |||
1922 | 1743 | : @return the standard deviation, as numeric type | 1711 | : @return the standard deviation, as numeric type |
1923 | 1744 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq | 1712 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq |
1924 | 1745 | :) | 1713 | :) |
1926 | 1746 | declare function math:stdeva($numbers as xs:double+) as xs:double | 1714 | declare function math:stdeva($numbers as double+) as double |
1927 | 1747 | { | 1715 | { |
1928 | 1748 | W3Cmath:sqrt(math:vara($numbers)) | 1716 | W3Cmath:sqrt(math:vara($numbers)) |
1929 | 1749 | }; | 1717 | }; |
1930 | 1750 | 1718 | ||
1931 | 1751 | (:~ | 1719 | (:~ |
1934 | 1752 | : Borrowed from excel module.<br/> | 1720 | : Calculates standard deviation based on the entire population given as arguments. <p/> |
1933 | 1753 | : Calculates standard deviation based on the entire population given as arguments. | ||
1935 | 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 |
1936 | 1755 | : the average value (the mean). | 1722 | : the average value (the mean). |
1937 | 1756 | : It is computed with formula: | 1723 | : It is computed with formula: |
1939 | 1757 | : sqrt( sum((x-average_x)^2) / n ) = sqrt ( VARP(numbers) ) | 1724 | : sqrt( sum((x-average_x)^2) / n ) = sqrt ( VARP(numbers) )<p/> |
1940 | 1725 | : Borrowed from excel module. | ||
1941 | 1758 | : | 1726 | : |
1942 | 1759 | : @see http://office.microsoft.com/en-us/excel/HP052092811033.aspx | 1727 | : @see http://office.microsoft.com/en-us/excel/HP052092811033.aspx |
1943 | 1760 | : @param $numbers the sequence of numbers or values castable to numeric | 1728 | : @param $numbers the sequence of numbers or values castable to numeric |
1944 | @@ -1762,18 +1730,18 @@ | |||
1945 | 1762 | : @return the standard deviation, as numeric type | 1730 | : @return the standard deviation, as numeric type |
1946 | 1763 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq | 1731 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq |
1947 | 1764 | :) | 1732 | :) |
1949 | 1765 | declare function math:stdevp($numbers as xs:double+) as xs:double | 1733 | declare function math:stdevp($numbers as double+) as double |
1950 | 1766 | { | 1734 | { |
1951 | 1767 | W3Cmath:sqrt(math:varp($numbers)) | 1735 | W3Cmath:sqrt(math:varp($numbers)) |
1952 | 1768 | }; | 1736 | }; |
1953 | 1769 | 1737 | ||
1954 | 1770 | (:~ | 1738 | (:~ |
1957 | 1771 | : Borrowed from excel module.<br/> | 1739 | : Calculates standard deviation based on the entire population given as arguments. <p/> |
1956 | 1772 | : Calculates standard deviation based on the entire population given as arguments. | ||
1958 | 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 |
1959 | 1774 | : the average value (the mean). | 1741 | : the average value (the mean). |
1960 | 1775 | : It is computed with formula: | 1742 | : It is computed with formula: |
1962 | 1776 | : sqrt( sum((x-average_x)^2) / n ) = sqrt ( VARPA(numbers) ) | 1743 | : sqrt( sum((x-average_x)^2) / n ) = sqrt ( VARPA(numbers) )<p/> |
1963 | 1744 | : Borrowed from excel module. | ||
1964 | 1777 | : | 1745 | : |
1965 | 1778 | : @see http://office.microsoft.com/en-us/excel/HP052092831033.aspx | 1746 | : @see http://office.microsoft.com/en-us/excel/HP052092831033.aspx |
1966 | 1779 | : @param $numbers the sequence of numbers or values castable to numeric | 1747 | : @param $numbers the sequence of numbers or values castable to numeric |
1967 | @@ -1781,15 +1749,15 @@ | |||
1968 | 1781 | : @return the standard deviation, as numeric type | 1749 | : @return the standard deviation, as numeric type |
1969 | 1782 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq | 1750 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq |
1970 | 1783 | :) | 1751 | :) |
1972 | 1784 | declare function math:stdevpa($numbers as xs:double+) as xs:double | 1752 | declare function math:stdevpa($numbers as double+) as double |
1973 | 1785 | { | 1753 | { |
1974 | 1786 | W3Cmath:sqrt(math:varpa($numbers)) | 1754 | W3Cmath:sqrt(math:varpa($numbers)) |
1975 | 1787 | }; | 1755 | }; |
1976 | 1788 | 1756 | ||
1977 | 1789 | (:~ | 1757 | (:~ |
1981 | 1790 | : Borrowed from excel module.<br/> | 1758 | : Returns a subtotal in a sequence of numbers.<p/> |
1982 | 1791 | : Returns a subtotal in a sequence of numbers. | 1759 | : The function applied is given by $function_num.<p/> |
1983 | 1792 | : The function applied is given by $function_num. | 1760 | : Borrowed from excel module. |
1984 | 1793 | : | 1761 | : |
1985 | 1794 | : @see http://office.microsoft.com/en-us/excel/HP052092881033.aspx | 1762 | : @see http://office.microsoft.com/en-us/excel/HP052092881033.aspx |
1986 | 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. |
1987 | @@ -1811,7 +1779,7 @@ | |||
1988 | 1811 | : The sequence can be of any length. | 1779 | : The sequence can be of any length. |
1989 | 1812 | : @return The function result, as numeric type | 1780 | : @return The function result, as numeric type |
1990 | 1813 | : @error * depends on the function called | 1781 | : @error * depends on the function called |
1992 | 1814 | : @error math:errNum if $function_num is not a value between 1 .. 11 or 101 .. 111 | 1782 | : @error math:INVALID_ARGUMENT if $function_num is not a value between 1 .. 11 or 101 .. 111 |
1993 | 1815 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq | 1783 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq |
1994 | 1816 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq | 1784 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq |
1995 | 1817 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq | 1785 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq |
1996 | @@ -1824,40 +1792,40 @@ | |||
1997 | 1824 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq | 1792 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq |
1998 | 1825 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq | 1793 | : @example test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq |
1999 | 1826 | :) | 1794 | :) |
2001 | 1827 | declare function math:subtotal($function_num as xs:integer, $numbers as xs:double*) as xs:double | 1795 | declare function math:subtotal($function_num as integer, $numbers as double*) as double |
2002 | 1828 | { | 1796 | { |
2004 | 1829 | if ($function_num = 1 or $function_num = 101) then | 1797 | if ($function_num eq 1 or $function_num eq 101) then |
2005 | 1830 | fn:avg($numbers) | 1798 | fn:avg($numbers) |
2006 | 1831 | else | 1799 | else |
2014 | 1832 | if ($function_num = 2 or $function_num = 102) then | 1800 | if ($function_num eq 2 or $function_num eq 102) then |
2015 | 1833 | fn:count($numbers) | 1801 | fn:count($numbers) |
2016 | 1834 | else | 1802 | else |
2017 | 1835 | if ($function_num = 3 or $function_num = 103) then | 1803 | if ($function_num eq 3 or $function_num eq 103) then |
2018 | 1836 | fn:count($numbers) | 1804 | fn:count($numbers) |
2019 | 1837 | else | 1805 | else |
2020 | 1838 | if ($function_num = 4 or $function_num = 104) then | 1806 | if ($function_num eq 4 or $function_num eq 104) then |
2021 | 1839 | fn:max($numbers) | 1807 | fn:max($numbers) |
2022 | 1840 | else | 1808 | else |
2024 | 1841 | if ($function_num = 5 or $function_num = 105) then | 1809 | if ($function_num eq 5 or $function_num eq 105) then |
2025 | 1842 | fn:min($numbers) | 1810 | fn:min($numbers) |
2026 | 1843 | else | 1811 | else |
2028 | 1844 | if ($function_num = 6 or $function_num = 106) then | 1812 | if ($function_num eq 6 or $function_num eq 106) then |
2029 | 1845 | math:product($numbers) | 1813 | math:product($numbers) |
2030 | 1846 | else | 1814 | else |
2032 | 1847 | if ($function_num = 7 or $function_num = 107) then | 1815 | if ($function_num eq 7 or $function_num eq 107) then |
2033 | 1848 | math:stdev($numbers) | 1816 | math:stdev($numbers) |
2034 | 1849 | else | 1817 | else |
2036 | 1850 | if ($function_num = 8 or $function_num = 108) then | 1818 | if ($function_num eq 8 or $function_num eq 108) then |
2037 | 1851 | math:stdevp($numbers) | 1819 | math:stdevp($numbers) |
2038 | 1852 | else | 1820 | else |
2040 | 1853 | if ($function_num = 9 or $function_num = 109) then | 1821 | if ($function_num eq 9 or $function_num eq 109) then |
2041 | 1854 | fn:sum($numbers) | 1822 | fn:sum($numbers) |
2042 | 1855 | else | 1823 | else |
2044 | 1856 | if ($function_num = 10 or $function_num = 110) then | 1824 | if ($function_num eq 10 or $function_num eq 110) then |
2045 | 1857 | math:var($numbers) | 1825 | math:var($numbers) |
2046 | 1858 | else | 1826 | else |
2048 | 1859 | if ($function_num = 11 or $function_num = 111) then | 1827 | if ($function_num eq 11 or $function_num eq 111) then |
2049 | 1860 | math:varp($numbers) | 1828 | math:varp($numbers) |
2050 | 1861 | else | 1829 | else |
2052 | 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") |
2053 | 1863 | }; | 1831 | }; |
2054 | 1864 | 1832 | ||
2055 | === renamed file 'modules/com/zorba-xquery/www/modules/random.xq' => 'modules/atomic/random.xq' | |||
2056 | --- modules/com/zorba-xquery/www/modules/random.xq 2013-06-25 03:55:20 +0000 | |||
2057 | +++ modules/atomic/random.xq 2013-07-17 15:56:30 +0000 | |||
2058 | @@ -1,7 +1,7 @@ | |||
2060 | 1 | xquery version "3.0"; | 1 | jsoniq version "1.0"; |
2061 | 2 | 2 | ||
2062 | 3 | (: | 3 | (: |
2064 | 4 | : Copyright 2006-2009 The FLWOR Foundation. | 4 | : Copyright 2006-2013 The FLWOR Foundation. |
2065 | 5 | : | 5 | : |
2066 | 6 | : Licensed under the Apache License, Version 2.0 (the "License"); | 6 | : Licensed under the Apache License, Version 2.0 (the "License"); |
2067 | 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. |
2068 | @@ -24,18 +24,21 @@ | |||
2069 | 24 | : @project Zorba/XQuery Data Model/Atomic/Random | 24 | : @project Zorba/XQuery Data Model/Atomic/Random |
2070 | 25 | : | 25 | : |
2071 | 26 | :) | 26 | :) |
2073 | 27 | module namespace r = "http://www.zorba-xquery.com/modules/random"; | 27 | module namespace r = "http://zorba.io/modules/random"; |
2074 | 28 | 28 | ||
2075 | 29 | declare namespace an = "http://www.zorba-xquery.com/annotations"; | 29 | declare namespace an = "http://www.zorba-xquery.com/annotations"; |
2076 | 30 | declare namespace zerr = "http://zorba.io/modules/zorba-errors"; | 30 | declare namespace zerr = "http://zorba.io/modules/zorba-errors"; |
2077 | 31 | 31 | ||
2078 | 32 | declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; | 32 | declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; |
2080 | 33 | declare option ver:module-version "2.0"; | 33 | declare option ver:module-version "1.0"; |
2081 | 34 | |||
2082 | 35 | declare %private variable $r:errNS as string := "http://zorba.io/modules/random"; | ||
2083 | 36 | declare %private variable $r:INVALID_ARGUMENT as QName := fn:QName($r:errNS, "r:INVALID_ARGUMENT"); | ||
2084 | 34 | 37 | ||
2085 | 35 | (:~ | 38 | (:~ |
2087 | 36 | : This function generates an arbitrary number of pseudo-random numbers. | 39 | : <p>This function generates an arbitrary number of pseudo-random numbers. |
2088 | 37 | : The sequence is repeatable by calling the function with the same | 40 | : The sequence is repeatable by calling the function with the same |
2090 | 38 | : seed. | 41 | : seed.</p> |
2091 | 39 | : | 42 | : |
2092 | 40 | : <p>The function is based on posix function <tt>srand()</tt> and | 43 | : <p>The function is based on posix function <tt>srand()</tt> and |
2093 | 41 | : <tt>rand()</tt>. Specifically, it invokes <tt>srand($seed)</tt> | 44 | : <tt>rand()</tt>. Specifically, it invokes <tt>srand($seed)</tt> |
2094 | @@ -56,14 +59,14 @@ | |||
2095 | 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. |
2096 | 57 | :) | 60 | :) |
2097 | 58 | declare function r:seeded-random( | 61 | declare function r:seeded-random( |
2101 | 59 | $seed as xs:integer, | 62 | $seed as integer, |
2102 | 60 | $num as xs:integer | 63 | $num as integer |
2103 | 61 | ) as xs:integer* external; | 64 | ) as integer* external; |
2104 | 62 | 65 | ||
2105 | 63 | (:~ | 66 | (:~ |
2107 | 64 | : This function generates an arbitrary number of random numbers. | 67 | : <p>This function generates an arbitrary number of random numbers. |
2108 | 65 | : The function is nondeterministic because the sequence is | 68 | : The function is nondeterministic because the sequence is |
2110 | 66 | : <b>not</b> repeatable. | 69 | : <b>not</b> repeatable.</p> |
2111 | 67 | : | 70 | : |
2112 | 68 | : <p>However, the function is based on posix function <tt>srand()</tt> and | 71 | : <p>However, the function is based on posix function <tt>srand()</tt> and |
2113 | 69 | : <tt>rand()</tt>. Specifically, it invokes <tt>srand()</tt> | 72 | : <tt>rand()</tt>. Specifically, it invokes <tt>srand()</tt> |
2114 | @@ -76,30 +79,30 @@ | |||
2115 | 76 | : sequence if <tt>$num</tt> is negative. | 79 | : sequence if <tt>$num</tt> is negative. |
2116 | 77 | :) | 80 | :) |
2117 | 78 | declare %an:nondeterministic function r:random( | 81 | declare %an:nondeterministic function r:random( |
2120 | 79 | $num as xs:integer | 82 | $num as integer |
2121 | 80 | ) as xs:integer* external; | 83 | ) as integer* external; |
2122 | 81 | 84 | ||
2123 | 82 | (:~ | 85 | (:~ |
2126 | 83 | : This function generates one random number. | 86 | : <p>This function generates one random number. |
2127 | 84 | : The function is nondeterministic. | 87 | : The function is nondeterministic.</p> |
2128 | 85 | : | 88 | : |
2129 | 86 | : <p>The function is based on <tt>r:random#1</tt>. Specifically, it | 89 | : <p>The function is based on <tt>r:random#1</tt>. Specifically, it |
2130 | 87 | : returns the value of invoking <tt>r:random(1)</tt>.</p> | 90 | : returns the value of invoking <tt>r:random(1)</tt>.</p> |
2131 | 88 | : | 91 | : |
2132 | 89 | : @return a random integer | 92 | : @return a random integer |
2133 | 90 | :) | 93 | :) |
2135 | 91 | declare %an:nondeterministic function r:random() as xs:integer | 94 | declare %an:nondeterministic function r:random() as integer |
2136 | 92 | { | 95 | { |
2137 | 93 | r:random(1) | 96 | r:random(1) |
2138 | 94 | }; | 97 | }; |
2139 | 95 | 98 | ||
2140 | 96 | (:~ | 99 | (:~ |
2142 | 97 | : This function generates an arbitrary number of pseudo-random numbers | 100 | : <p>This function generates an arbitrary number of pseudo-random numbers |
2143 | 98 | : within a given range. The sequence is repeatable by calling the | 101 | : within a given range. The sequence is repeatable by calling the |
2145 | 99 | : function with the same seed and boundaries. | 102 | : function with the same seed and boundaries.</p> |
2146 | 100 | : | 103 | : |
2147 | 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>. |
2149 | 102 | : Specifically, it's result is repeatable if called with the | 105 | : Specifically, its result is repeatable if called with the |
2150 | 103 | : same arguments.</p> | 106 | : same arguments.</p> |
2151 | 104 | : | 107 | : |
2152 | 105 | : @param $seed the initial seed value for the sequence | 108 | : @param $seed the initial seed value for the sequence |
2153 | @@ -114,37 +117,37 @@ | |||
2154 | 114 | : | 117 | : |
2155 | 115 | : @error zerr:ZQXD0004 if the given seed is negative or great | 118 | : @error zerr:ZQXD0004 if the given seed is negative or great |
2156 | 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. |
2158 | 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> |
2159 | 118 | :) | 121 | :) |
2160 | 119 | declare function r:seeded-random-between( | 122 | declare function r:seeded-random-between( |
2166 | 120 | $seed as xs:integer, | 123 | $seed as integer, |
2167 | 121 | $lower as xs:integer, | 124 | $lower as integer, |
2168 | 122 | $upper as xs:integer, | 125 | $upper as integer, |
2169 | 123 | $num as xs:integer | 126 | $num as integer |
2170 | 124 | ) as xs:integer* | 127 | ) as integer* |
2171 | 125 | { | 128 | { |
2172 | 126 | if ( $lower eq $upper ) then | 129 | if ( $lower eq $upper ) then |
2173 | 127 | $lower | 130 | $lower |
2174 | 128 | else | 131 | else |
2176 | 129 | if ( $lower > $upper ) then | 132 | if ( $lower gt $upper ) then |
2177 | 130 | fn:error( | 133 | fn:error( |
2180 | 131 | fn:QName("http://www.zorba-xquery.com/modules/random", "invalid-arg"), | 134 | $r:INVALID_ARGUMENT, |
2181 | 132 | "$lower must be smaller or equal than $upper", | 135 | "$lower must be less than or equal to $upper", |
2182 | 133 | ($lower, $upper) | 136 | ($lower, $upper) |
2183 | 134 | ) | 137 | ) |
2184 | 135 | else | 138 | else |
2185 | 136 | for $i in r:seeded-random( $seed, $num ) | 139 | for $i in r:seeded-random( $seed, $num ) |
2186 | 137 | return | 140 | return |
2187 | 138 | if ( ( $upper - $lower ) lt 10000 ) then | 141 | if ( ( $upper - $lower ) lt 10000 ) then |
2189 | 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 ) |
2190 | 140 | else | 143 | else |
2192 | 141 | xs:integer( fn:round( xs:double( $i ) mod ( $upper - $lower ) ) + $lower ) | 144 | integer( fn:round( double( $i ) mod ( $upper - $lower ) ) + $lower ) |
2193 | 142 | }; | 145 | }; |
2194 | 143 | 146 | ||
2195 | 144 | (:~ | 147 | (:~ |
2197 | 145 | : This function generates an arbitrary number of random numbers | 148 | : <p>This function generates an arbitrary number of random numbers |
2198 | 146 | : within a given range. The function is nondeterministic because | 149 | : within a given range. The function is nondeterministic because |
2200 | 147 | : the sequence is <b>not</b> repeatable. | 150 | : the sequence is <b>not</b> repeatable.</p> |
2201 | 148 | : | 151 | : |
2202 | 149 | : @param $lower the lower bound for every value within the sequence | 152 | : @param $lower the lower bound for every value within the sequence |
2203 | 150 | : @param $upper the upper bound for every value within the sequence | 153 | : @param $upper the upper bound for every value within the sequence |
2204 | @@ -155,34 +158,34 @@ | |||
2205 | 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> |
2206 | 156 | : is negative. | 159 | : is negative. |
2207 | 157 | : | 160 | : |
2209 | 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> |
2210 | 159 | :) | 162 | :) |
2211 | 160 | declare %an:nondeterministic function r:random-between( | 163 | declare %an:nondeterministic function r:random-between( |
2215 | 161 | $lower as xs:integer, | 164 | $lower as integer, |
2216 | 162 | $upper as xs:integer, | 165 | $upper as integer, |
2217 | 163 | $num as xs:integer) as xs:integer* | 166 | $num as integer) as integer* |
2218 | 164 | { | 167 | { |
2219 | 165 | if ( $lower eq $upper ) then | 168 | if ( $lower eq $upper ) then |
2220 | 166 | $lower | 169 | $lower |
2221 | 167 | else | 170 | else |
2223 | 168 | if ( $lower > $upper ) then | 171 | if ( $lower gt $upper ) then |
2224 | 169 | fn:error( | 172 | fn:error( |
2227 | 170 | fn:QName("http://www.zorba-xquery.com/modules/random", "invalid-arg"), | 173 | $r:INVALID_ARGUMENT, |
2228 | 171 | "$lower must be smaller or equal than $upper", | 174 | "$lower must be less than or equal to $upper", |
2229 | 172 | ($lower, $upper) | 175 | ($lower, $upper) |
2230 | 173 | ) | 176 | ) |
2231 | 174 | else | 177 | else |
2232 | 175 | for $i in r:random( $num ) | 178 | for $i in r:random( $num ) |
2233 | 176 | return | 179 | return |
2234 | 177 | if ( ( $upper - $lower ) lt 10000 ) then | 180 | if ( ( $upper - $lower ) lt 10000 ) then |
2236 | 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 ) |
2237 | 179 | else | 182 | else |
2239 | 180 | xs:integer( fn:round( xs:double( $i ) mod ( $upper - $lower ) ) + $lower ) | 183 | integer( fn:round( double( $i ) mod ( $upper - $lower ) ) + $lower ) |
2240 | 181 | }; | 184 | }; |
2241 | 182 | 185 | ||
2242 | 183 | (:~ | 186 | (:~ |
2245 | 184 | : This function generates one random number within a given range. | 187 | : <p>This function generates one random number within a given range. |
2246 | 185 | : The function is nondeterministic. | 188 | : The function is nondeterministic.</p> |
2247 | 186 | : | 189 | : |
2248 | 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>. |
2249 | 188 | : Specifically, it returns the value of invoking | 191 | : Specifically, it returns the value of invoking |
2250 | @@ -193,18 +196,19 @@ | |||
2251 | 193 | : @return a random integer within the given range | 196 | : @return a random integer within the given range |
2252 | 194 | :) | 197 | :) |
2253 | 195 | declare %an:nondeterministic function r:random-between( | 198 | declare %an:nondeterministic function r:random-between( |
2257 | 196 | $lower as xs:integer, | 199 | $lower as integer, |
2258 | 197 | $upper as xs:integer | 200 | $upper as integer |
2259 | 198 | ) as xs:integer | 201 | ) as integer |
2260 | 199 | { | 202 | { |
2261 | 200 | r:random-between($lower, $upper, 1) | 203 | r:random-between($lower, $upper, 1) |
2262 | 201 | }; | 204 | }; |
2263 | 202 | 205 | ||
2264 | 203 | (:~ | 206 | (:~ |
2267 | 204 | : This function returns a uuid. Note, that the function is not stable, | 207 | : <p>This function returns a uuid.</p> |
2268 | 205 | : that is, it returns a different UUID everytime the function is invoked. | 208 | : <p> Note, that the function is not stable, |
2269 | 209 | : that is, it returns a different UUID everytime the function is invoked.</p> | ||
2270 | 206 | : | 210 | : |
2272 | 207 | : @return the generated UUID as xs:string | 211 | : @return the generated UUID as string |
2273 | 208 | :) | 212 | :) |
2275 | 209 | declare %an:nondeterministic function r:uuid() as xs:string external; | 213 | declare %an:nondeterministic function r:uuid() as string external; |
2276 | 210 | 214 | ||
2277 | 211 | 215 | ||
2278 | === removed directory 'modules/base64' | |||
2279 | === removed file 'modules/base64/CMakeLists.txt' | |||
2280 | --- modules/base64/CMakeLists.txt 2013-07-17 07:20:31 +0000 | |||
2281 | +++ modules/base64/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
2282 | @@ -1,16 +0,0 @@ | |||
2283 | 1 | # Copyright 2013 The FLWOR Foundation. | ||
2284 | 2 | # | ||
2285 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
2286 | 4 | # you may not use this file except in compliance with the License. | ||
2287 | 5 | # You may obtain a copy of the License at | ||
2288 | 6 | # | ||
2289 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
2290 | 8 | # | ||
2291 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
2292 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
2293 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
2294 | 12 | # See the License for the specific language governing permissions and | ||
2295 | 13 | # limitations under the License. | ||
2296 | 14 | |||
2297 | 15 | DECLARE_ZORBA_MODULE(FILE base64.xq VERSION 1.0 | ||
2298 | 16 | URI "http://zorba.io/modules/base64") | ||
2299 | 17 | 0 | ||
2300 | === modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt' | |||
2301 | --- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2013-07-17 07:20:31 +0000 | |||
2302 | +++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2013-07-17 15:56:30 +0000 | |||
2303 | @@ -56,8 +56,6 @@ | |||
2304 | 56 | URI "http://www.zorba-xquery.com/modules/datetime") | 56 | URI "http://www.zorba-xquery.com/modules/datetime") |
2305 | 57 | DECLARE_ZORBA_MODULE(FILE fetch.xq VERSION 2.0 | 57 | DECLARE_ZORBA_MODULE(FILE fetch.xq VERSION 2.0 |
2306 | 58 | URI "http://www.zorba-xquery.com/modules/fetch") | 58 | URI "http://www.zorba-xquery.com/modules/fetch") |
2307 | 59 | DECLARE_ZORBA_MODULE(FILE math.xq VERSION 2.0 | ||
2308 | 60 | URI "http://www.zorba-xquery.com/modules/math") | ||
2309 | 61 | DECLARE_ZORBA_MODULE(FILE node-reference.xq VERSION 2.0 | 59 | DECLARE_ZORBA_MODULE(FILE node-reference.xq VERSION 2.0 |
2310 | 62 | URI "http://www.zorba-xquery.com/modules/node-reference") | 60 | URI "http://www.zorba-xquery.com/modules/node-reference") |
2311 | 63 | DECLARE_ZORBA_MODULE(FILE reference.xq VERSION 1.0 | 61 | DECLARE_ZORBA_MODULE(FILE reference.xq VERSION 1.0 |
2312 | @@ -66,8 +64,6 @@ | |||
2313 | 66 | URI "http://www.zorba-xquery.com/modules/node") | 64 | URI "http://www.zorba-xquery.com/modules/node") |
2314 | 67 | DECLARE_ZORBA_MODULE(FILE item.xq VERSION 1.0 | 65 | DECLARE_ZORBA_MODULE(FILE item.xq VERSION 1.0 |
2315 | 68 | URI "http://www.zorba-xquery.com/modules/item") | 66 | URI "http://www.zorba-xquery.com/modules/item") |
2316 | 69 | DECLARE_ZORBA_MODULE(FILE random.xq VERSION 2.0 | ||
2317 | 70 | URI "http://www.zorba-xquery.com/modules/random") | ||
2318 | 71 | DECLARE_ZORBA_MODULE(FILE reflection.xq VERSION 2.0 | 67 | DECLARE_ZORBA_MODULE(FILE reflection.xq VERSION 2.0 |
2319 | 72 | URI "http://www.zorba-xquery.com/modules/reflection") | 68 | URI "http://www.zorba-xquery.com/modules/reflection") |
2320 | 73 | DECLARE_ZORBA_MODULE(FILE schema.xq VERSION 2.0 | 69 | DECLARE_ZORBA_MODULE(FILE schema.xq VERSION 2.0 |
2321 | 74 | 70 | ||
2322 | === modified file 'src/context/static_context.cpp' | |||
2323 | --- src/context/static_context.cpp 2013-07-17 07:20:31 +0000 | |||
2324 | +++ src/context/static_context.cpp 2013-07-17 15:56:30 +0000 | |||
2325 | @@ -353,7 +353,7 @@ | |||
2326 | 353 | 353 | ||
2327 | 354 | const char* | 354 | const char* |
2328 | 355 | static_context::ZORBA_MATH_FN_NS = | 355 | static_context::ZORBA_MATH_FN_NS = |
2330 | 356 | "http://www.zorba-xquery.com/modules/math"; | 356 | "http://zorba.io/modules/math"; |
2331 | 357 | 357 | ||
2332 | 358 | const char* | 358 | const char* |
2333 | 359 | static_context::ZORBA_BASE64_FN_NS = | 359 | static_context::ZORBA_BASE64_FN_NS = |
2334 | @@ -433,7 +433,7 @@ | |||
2335 | 433 | 433 | ||
2336 | 434 | const char* | 434 | const char* |
2337 | 435 | static_context::ZORBA_RANDOM_FN_NS = | 435 | static_context::ZORBA_RANDOM_FN_NS = |
2339 | 436 | "http://www.zorba-xquery.com/modules/random"; | 436 | "http://zorba.io/modules/random"; |
2340 | 437 | 437 | ||
2341 | 438 | const char* | 438 | const char* |
2342 | 439 | static_context::ZORBA_INTROSP_SCTX_FN_NS = | 439 | static_context::ZORBA_INTROSP_SCTX_FN_NS = |
2343 | 440 | 440 | ||
2344 | === modified file 'src/functions/pregenerated/func_maths.cpp' | |||
2345 | --- src/functions/pregenerated/func_maths.cpp 2013-03-05 23:11:50 +0000 | |||
2346 | +++ src/functions/pregenerated/func_maths.cpp 2013-07-17 15:56:30 +0000 | |||
2347 | @@ -442,7 +442,7 @@ | |||
2348 | 442 | 442 | ||
2349 | 443 | { | 443 | { |
2350 | 444 | DECL_WITH_KIND(sctx, fn_zorba_math_cosh, | 444 | DECL_WITH_KIND(sctx, fn_zorba_math_cosh, |
2352 | 445 | (createQName("http://www.zorba-xquery.com/modules/math","","cosh"), | 445 | (createQName("http://zorba.io/modules/math","","cosh"), |
2353 | 446 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 446 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2354 | 447 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), | 447 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), |
2355 | 448 | FunctionConsts::FN_ZORBA_MATH_COSH_1); | 448 | FunctionConsts::FN_ZORBA_MATH_COSH_1); |
2356 | @@ -454,7 +454,7 @@ | |||
2357 | 454 | 454 | ||
2358 | 455 | { | 455 | { |
2359 | 456 | DECL_WITH_KIND(sctx, fn_zorba_math_acosh, | 456 | DECL_WITH_KIND(sctx, fn_zorba_math_acosh, |
2361 | 457 | (createQName("http://www.zorba-xquery.com/modules/math","","acosh"), | 457 | (createQName("http://zorba.io/modules/math","","acosh"), |
2362 | 458 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 458 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2363 | 459 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), | 459 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), |
2364 | 460 | FunctionConsts::FN_ZORBA_MATH_ACOSH_1); | 460 | FunctionConsts::FN_ZORBA_MATH_ACOSH_1); |
2365 | @@ -466,7 +466,7 @@ | |||
2366 | 466 | 466 | ||
2367 | 467 | { | 467 | { |
2368 | 468 | DECL_WITH_KIND(sctx, fn_zorba_math_fmod, | 468 | DECL_WITH_KIND(sctx, fn_zorba_math_fmod, |
2370 | 469 | (createQName("http://www.zorba-xquery.com/modules/math","","fmod"), | 469 | (createQName("http://zorba.io/modules/math","","fmod"), |
2371 | 470 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 470 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2372 | 471 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 471 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2373 | 472 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), | 472 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), |
2374 | @@ -479,7 +479,7 @@ | |||
2375 | 479 | 479 | ||
2376 | 480 | { | 480 | { |
2377 | 481 | DECL_WITH_KIND(sctx, fn_zorba_math_ldexp, | 481 | DECL_WITH_KIND(sctx, fn_zorba_math_ldexp, |
2379 | 482 | (createQName("http://www.zorba-xquery.com/modules/math","","ldexp"), | 482 | (createQName("http://zorba.io/modules/math","","ldexp"), |
2380 | 483 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 483 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2381 | 484 | GENV_TYPESYSTEM.INTEGER_TYPE_ONE, | 484 | GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
2382 | 485 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), | 485 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), |
2383 | @@ -505,7 +505,7 @@ | |||
2384 | 505 | 505 | ||
2385 | 506 | { | 506 | { |
2386 | 507 | DECL_WITH_KIND(sctx, fn_zorba_math_sinh, | 507 | DECL_WITH_KIND(sctx, fn_zorba_math_sinh, |
2388 | 508 | (createQName("http://www.zorba-xquery.com/modules/math","","sinh"), | 508 | (createQName("http://zorba.io/modules/math","","sinh"), |
2389 | 509 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 509 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2390 | 510 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), | 510 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), |
2391 | 511 | FunctionConsts::FN_ZORBA_MATH_SINH_1); | 511 | FunctionConsts::FN_ZORBA_MATH_SINH_1); |
2392 | @@ -517,7 +517,7 @@ | |||
2393 | 517 | 517 | ||
2394 | 518 | { | 518 | { |
2395 | 519 | DECL_WITH_KIND(sctx, fn_zorba_math_asinh, | 519 | DECL_WITH_KIND(sctx, fn_zorba_math_asinh, |
2397 | 520 | (createQName("http://www.zorba-xquery.com/modules/math","","asinh"), | 520 | (createQName("http://zorba.io/modules/math","","asinh"), |
2398 | 521 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 521 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2399 | 522 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), | 522 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), |
2400 | 523 | FunctionConsts::FN_ZORBA_MATH_ASINH_1); | 523 | FunctionConsts::FN_ZORBA_MATH_ASINH_1); |
2401 | @@ -529,7 +529,7 @@ | |||
2402 | 529 | 529 | ||
2403 | 530 | { | 530 | { |
2404 | 531 | DECL_WITH_KIND(sctx, fn_zorba_math_tanh, | 531 | DECL_WITH_KIND(sctx, fn_zorba_math_tanh, |
2406 | 532 | (createQName("http://www.zorba-xquery.com/modules/math","","tanh"), | 532 | (createQName("http://zorba.io/modules/math","","tanh"), |
2407 | 533 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 533 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2408 | 534 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), | 534 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), |
2409 | 535 | FunctionConsts::FN_ZORBA_MATH_TANH_1); | 535 | FunctionConsts::FN_ZORBA_MATH_TANH_1); |
2410 | @@ -541,7 +541,7 @@ | |||
2411 | 541 | 541 | ||
2412 | 542 | { | 542 | { |
2413 | 543 | DECL_WITH_KIND(sctx, fn_zorba_math_atanh, | 543 | DECL_WITH_KIND(sctx, fn_zorba_math_atanh, |
2415 | 544 | (createQName("http://www.zorba-xquery.com/modules/math","","atanh"), | 544 | (createQName("http://zorba.io/modules/math","","atanh"), |
2416 | 545 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 545 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2417 | 546 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), | 546 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE), |
2418 | 547 | FunctionConsts::FN_ZORBA_MATH_ATANH_1); | 547 | FunctionConsts::FN_ZORBA_MATH_ATANH_1); |
2419 | @@ -564,7 +564,7 @@ | |||
2420 | 564 | 564 | ||
2421 | 565 | { | 565 | { |
2422 | 566 | DECL_WITH_KIND(sctx, fn_zorba_math_is_inf, | 566 | DECL_WITH_KIND(sctx, fn_zorba_math_is_inf, |
2424 | 567 | (createQName("http://www.zorba-xquery.com/modules/math","","is_inf"), | 567 | (createQName("http://zorba.io/modules/math","","is_inf"), |
2425 | 568 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 568 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2426 | 569 | GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), | 569 | GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
2427 | 570 | FunctionConsts::FN_ZORBA_MATH_IS_INF_1); | 570 | FunctionConsts::FN_ZORBA_MATH_IS_INF_1); |
2428 | @@ -576,7 +576,7 @@ | |||
2429 | 576 | 576 | ||
2430 | 577 | { | 577 | { |
2431 | 578 | DECL_WITH_KIND(sctx, fn_zorba_math_is_nan, | 578 | DECL_WITH_KIND(sctx, fn_zorba_math_is_nan, |
2433 | 579 | (createQName("http://www.zorba-xquery.com/modules/math","","is_nan"), | 579 | (createQName("http://zorba.io/modules/math","","is_nan"), |
2434 | 580 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 580 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2435 | 581 | GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), | 581 | GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), |
2436 | 582 | FunctionConsts::FN_ZORBA_MATH_IS_NAN_1); | 582 | FunctionConsts::FN_ZORBA_MATH_IS_NAN_1); |
2437 | @@ -588,7 +588,7 @@ | |||
2438 | 588 | 588 | ||
2439 | 589 | { | 589 | { |
2440 | 590 | DECL_WITH_KIND(sctx, fn_zorba_math_modf, | 590 | DECL_WITH_KIND(sctx, fn_zorba_math_modf, |
2442 | 591 | (createQName("http://www.zorba-xquery.com/modules/math","","modf"), | 591 | (createQName("http://zorba.io/modules/math","","modf"), |
2443 | 592 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 592 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2444 | 593 | GENV_TYPESYSTEM.DOUBLE_TYPE_PLUS), | 593 | GENV_TYPESYSTEM.DOUBLE_TYPE_PLUS), |
2445 | 594 | FunctionConsts::FN_ZORBA_MATH_MODF_1); | 594 | FunctionConsts::FN_ZORBA_MATH_MODF_1); |
2446 | @@ -600,7 +600,7 @@ | |||
2447 | 600 | 600 | ||
2448 | 601 | { | 601 | { |
2449 | 602 | DECL_WITH_KIND(sctx, fn_zorba_math_frexp, | 602 | DECL_WITH_KIND(sctx, fn_zorba_math_frexp, |
2451 | 603 | (createQName("http://www.zorba-xquery.com/modules/math","","frexp"), | 603 | (createQName("http://zorba.io/modules/math","","frexp"), |
2452 | 604 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, | 604 | GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, |
2453 | 605 | GENV_TYPESYSTEM.DOUBLE_TYPE_PLUS), | 605 | GENV_TYPESYSTEM.DOUBLE_TYPE_PLUS), |
2454 | 606 | FunctionConsts::FN_ZORBA_MATH_FREXP_1); | 606 | FunctionConsts::FN_ZORBA_MATH_FREXP_1); |
2455 | 607 | 607 | ||
2456 | === modified file 'src/functions/pregenerated/func_random.cpp' | |||
2457 | --- src/functions/pregenerated/func_random.cpp 2013-03-05 23:11:50 +0000 | |||
2458 | +++ src/functions/pregenerated/func_random.cpp 2013-07-17 15:56:30 +0000 | |||
2459 | @@ -67,7 +67,7 @@ | |||
2460 | 67 | 67 | ||
2461 | 68 | { | 68 | { |
2462 | 69 | DECL_WITH_KIND(sctx, fn_zorba_random_seeded_random, | 69 | DECL_WITH_KIND(sctx, fn_zorba_random_seeded_random, |
2464 | 70 | (createQName("http://www.zorba-xquery.com/modules/random","","seeded-random"), | 70 | (createQName("http://zorba.io/modules/random","","seeded-random"), |
2465 | 71 | GENV_TYPESYSTEM.INTEGER_TYPE_ONE, | 71 | GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
2466 | 72 | GENV_TYPESYSTEM.INTEGER_TYPE_ONE, | 72 | GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
2467 | 73 | GENV_TYPESYSTEM.INTEGER_TYPE_STAR), | 73 | GENV_TYPESYSTEM.INTEGER_TYPE_STAR), |
2468 | @@ -80,7 +80,7 @@ | |||
2469 | 80 | 80 | ||
2470 | 81 | { | 81 | { |
2471 | 82 | DECL_WITH_KIND(sctx, fn_zorba_random_random, | 82 | DECL_WITH_KIND(sctx, fn_zorba_random_random, |
2473 | 83 | (createQName("http://www.zorba-xquery.com/modules/random","","random"), | 83 | (createQName("http://zorba.io/modules/random","","random"), |
2474 | 84 | GENV_TYPESYSTEM.INTEGER_TYPE_ONE, | 84 | GENV_TYPESYSTEM.INTEGER_TYPE_ONE, |
2475 | 85 | GENV_TYPESYSTEM.INTEGER_TYPE_STAR), | 85 | GENV_TYPESYSTEM.INTEGER_TYPE_STAR), |
2476 | 86 | FunctionConsts::FN_ZORBA_RANDOM_RANDOM_1); | 86 | FunctionConsts::FN_ZORBA_RANDOM_RANDOM_1); |
2477 | @@ -103,7 +103,7 @@ | |||
2478 | 103 | 103 | ||
2479 | 104 | { | 104 | { |
2480 | 105 | DECL_WITH_KIND(sctx, fn_zorba_util_uuid, | 105 | DECL_WITH_KIND(sctx, fn_zorba_util_uuid, |
2482 | 106 | (createQName("http://www.zorba-xquery.com/modules/random","","uuid"), | 106 | (createQName("http://zorba.io/modules/random","","uuid"), |
2483 | 107 | GENV_TYPESYSTEM.STRING_TYPE_ONE), | 107 | GENV_TYPESYSTEM.STRING_TYPE_ONE), |
2484 | 108 | FunctionConsts::FN_ZORBA_RANDOM_UUID_0); | 108 | FunctionConsts::FN_ZORBA_RANDOM_UUID_0); |
2485 | 109 | 109 | ||
2486 | 110 | 110 | ||
2487 | === modified file 'src/runtime/spec/mappings.xml' | |||
2488 | --- src/runtime/spec/mappings.xml 2013-07-17 07:20:31 +0000 | |||
2489 | +++ src/runtime/spec/mappings.xml 2013-07-17 15:56:30 +0000 | |||
2490 | @@ -12,7 +12,7 @@ | |||
2491 | 12 | define="XQUERY_MATH_FN_NS" | 12 | define="XQUERY_MATH_FN_NS" |
2492 | 13 | prefix="math"/> | 13 | prefix="math"/> |
2493 | 14 | 14 | ||
2495 | 15 | <zorba:namespace uri="http://www.zorba-xquery.com/modules/math" | 15 | <zorba:namespace uri="http://zorba.io/modules/math" |
2496 | 16 | define="ZORBA_MATH_FN_NS" | 16 | define="ZORBA_MATH_FN_NS" |
2497 | 17 | prefix="fn-zorba-math"/> | 17 | prefix="fn-zorba-math"/> |
2498 | 18 | 18 | ||
2499 | @@ -94,7 +94,7 @@ | |||
2500 | 94 | define="ZORBA_XQDOC_FN_NS" | 94 | define="ZORBA_XQDOC_FN_NS" |
2501 | 95 | prefix="fn-zorba-xqdoc"/> | 95 | prefix="fn-zorba-xqdoc"/> |
2502 | 96 | 96 | ||
2504 | 97 | <zorba:namespace uri="http://www.zorba-xquery.com/modules/random" | 97 | <zorba:namespace uri="http://zorba.io/modules/random" |
2505 | 98 | define="ZORBA_RANDOM_FN_NS" | 98 | define="ZORBA_RANDOM_FN_NS" |
2506 | 99 | prefix="fn-zorba-random"/> | 99 | prefix="fn-zorba-random"/> |
2507 | 100 | 100 | ||
2508 | 101 | 101 | ||
2509 | === modified file 'test/rbkt/ExpQueryResults/zorba/random/seeded-random-between1.xml.res' | |||
2510 | --- test/rbkt/ExpQueryResults/zorba/random/seeded-random-between1.xml.res 2013-02-07 17:24:36 +0000 | |||
2511 | +++ test/rbkt/ExpQueryResults/zorba/random/seeded-random-between1.xml.res 2013-07-17 15:56:30 +0000 | |||
2512 | @@ -1,1 +1,1 @@ | |||
2514 | 1 | true true $lower must be smaller or equal than $upper 4 1 | 1 | true true $lower must be less than or equal to $upper 4 1 |
2515 | 2 | 2 | ||
2516 | === modified file 'test/rbkt/Queries/zorba/annotations/annot-err-05.xq' | |||
2517 | --- test/rbkt/Queries/zorba/annotations/annot-err-05.xq 2013-02-07 17:24:36 +0000 | |||
2518 | +++ test/rbkt/Queries/zorba/annotations/annot-err-05.xq 2013-07-17 15:56:30 +0000 | |||
2519 | @@ -1,6 +1,6 @@ | |||
2520 | 1 | declare namespace ann = "http://www.zorba-xquery.com/annotations"; | 1 | declare namespace ann = "http://www.zorba-xquery.com/annotations"; |
2521 | 2 | 2 | ||
2523 | 3 | declare namespace random = "http://www.zorba-xquery.com/modules/random"; | 3 | declare namespace random = "http://zorba.io/modules/random"; |
2524 | 4 | 4 | ||
2525 | 5 | declare %ann:deterministic %ann:deterministic function random:random() as xs:integer external; | 5 | declare %ann:deterministic %ann:deterministic function random:random() as xs:integer external; |
2526 | 6 | 6 | ||
2527 | 7 | 7 | ||
2528 | === modified file 'test/rbkt/Queries/zorba/annotations/annot-err-06.xq' | |||
2529 | --- test/rbkt/Queries/zorba/annotations/annot-err-06.xq 2013-02-07 17:24:36 +0000 | |||
2530 | +++ test/rbkt/Queries/zorba/annotations/annot-err-06.xq 2013-07-17 15:56:30 +0000 | |||
2531 | @@ -1,6 +1,6 @@ | |||
2532 | 1 | declare namespace ann = "http://www.zorba-xquery.com/annotations"; | 1 | declare namespace ann = "http://www.zorba-xquery.com/annotations"; |
2533 | 2 | 2 | ||
2535 | 3 | declare namespace random = "http://www.zorba-xquery.com/modules/random"; | 3 | declare namespace random = "http://zorba.io/modules/random"; |
2536 | 4 | 4 | ||
2537 | 5 | declare %ann:nondeterministic %ann:nondeterministic function random:random() as xs:integer external; | 5 | declare %ann:nondeterministic %ann:nondeterministic function random:random() as xs:integer external; |
2538 | 6 | 6 | ||
2539 | 7 | 7 | ||
2540 | === modified file 'test/rbkt/Queries/zorba/annotations/annot-err-07.xq' | |||
2541 | --- test/rbkt/Queries/zorba/annotations/annot-err-07.xq 2013-02-07 17:24:36 +0000 | |||
2542 | +++ test/rbkt/Queries/zorba/annotations/annot-err-07.xq 2013-07-17 15:56:30 +0000 | |||
2543 | @@ -1,6 +1,6 @@ | |||
2544 | 1 | declare namespace ann = "http://www.zorba-xquery.com/annotations"; | 1 | declare namespace ann = "http://www.zorba-xquery.com/annotations"; |
2545 | 2 | 2 | ||
2547 | 3 | declare namespace random = "http://www.zorba-xquery.com/modules/random"; | 3 | declare namespace random = "http://zorba.io/modules/random"; |
2548 | 4 | 4 | ||
2549 | 5 | declare %ann:deterministic %ann:nondeterministic function random:random() as xs:integer external; | 5 | declare %ann:deterministic %ann:nondeterministic function random:random() as xs:integer external; |
2550 | 6 | 6 | ||
2551 | 7 | 7 | ||
2552 | === modified file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_02.xq' | |||
2553 | --- test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_02.xq 2012-09-19 19:47:50 +0000 | |||
2554 | +++ test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_02.xq 2013-07-17 15:56:30 +0000 | |||
2555 | @@ -1,5 +1,5 @@ | |||
2556 | 1 | import module namespace f = "http://expath.org/ns/file"; | 1 | import module namespace f = "http://expath.org/ns/file"; |
2558 | 2 | import module namespace r = "http://www.zorba-xquery.com/modules/random"; | 2 | import module namespace r = "http://zorba.io/modules/random"; |
2559 | 3 | 3 | ||
2560 | 4 | import schema namespace o = "http://www.w3.org/2010/xslt-xquery-serialization"; | 4 | import schema namespace o = "http://www.w3.org/2010/xslt-xquery-serialization"; |
2561 | 5 | 5 | ||
2562 | 6 | 6 | ||
2563 | === modified file 'test/rbkt/Queries/zorba/math/acosh1.xq' | |||
2564 | --- test/rbkt/Queries/zorba/math/acosh1.xq 2013-02-07 17:24:36 +0000 | |||
2565 | +++ test/rbkt/Queries/zorba/math/acosh1.xq 2013-07-17 15:56:30 +0000 | |||
2566 | @@ -1,3 +1,3 @@ | |||
2568 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
2569 | 2 | 2 | ||
2570 | 3 | fn-zorba-math:acosh(8723321.4) | 3 | fn-zorba-math:acosh(8723321.4) |
2571 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
2572 | 5 | 5 | ||
2573 | === modified file 'test/rbkt/Queries/zorba/math/asinh1.xq' | |||
2574 | --- test/rbkt/Queries/zorba/math/asinh1.xq 2013-02-07 17:24:36 +0000 | |||
2575 | +++ test/rbkt/Queries/zorba/math/asinh1.xq 2013-07-17 15:56:30 +0000 | |||
2576 | @@ -1,3 +1,3 @@ | |||
2578 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
2579 | 2 | 2 | ||
2580 | 3 | fn-zorba-math:asinh(8723321.4) | 3 | fn-zorba-math:asinh(8723321.4) |
2581 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
2582 | 5 | 5 | ||
2583 | === modified file 'test/rbkt/Queries/zorba/math/atanh1.xq' | |||
2584 | --- test/rbkt/Queries/zorba/math/atanh1.xq 2013-02-07 17:24:36 +0000 | |||
2585 | +++ test/rbkt/Queries/zorba/math/atanh1.xq 2013-07-17 15:56:30 +0000 | |||
2586 | @@ -1,3 +1,3 @@ | |||
2588 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
2589 | 2 | 2 | ||
2590 | 3 | fn-zorba-math:atanh(0.3) | 3 | fn-zorba-math:atanh(0.3) |
2591 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
2592 | 5 | 5 | ||
2593 | === modified file 'test/rbkt/Queries/zorba/math/cosh1.xq' | |||
2594 | --- test/rbkt/Queries/zorba/math/cosh1.xq 2013-02-07 17:24:36 +0000 | |||
2595 | +++ test/rbkt/Queries/zorba/math/cosh1.xq 2013-07-17 15:56:30 +0000 | |||
2596 | @@ -1,3 +1,3 @@ | |||
2598 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
2599 | 2 | 2 | ||
2600 | 3 | fn-zorba-math:cosh(7.104760e+002) | 3 | fn-zorba-math:cosh(7.104760e+002) |
2601 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
2602 | 5 | 5 | ||
2603 | === modified file 'test/rbkt/Queries/zorba/math/cosh2.xq' | |||
2604 | --- test/rbkt/Queries/zorba/math/cosh2.xq 2013-02-07 17:24:36 +0000 | |||
2605 | +++ test/rbkt/Queries/zorba/math/cosh2.xq 2013-07-17 15:56:30 +0000 | |||
2606 | @@ -1,4 +1,4 @@ | |||
2607 | 1 | declare namespace math="http://www.w3.org/2005/xpath-functions/math"; | 1 | declare namespace math="http://www.w3.org/2005/xpath-functions/math"; |
2609 | 2 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 2 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
2610 | 3 | 3 | ||
2611 | 4 | fn-zorba-math:cosh(math:log(2)) | 4 | fn-zorba-math:cosh(math:log(2)) |
2612 | 5 | \ No newline at end of file | 5 | \ No newline at end of file |
2613 | 6 | 6 | ||
2614 | === modified file 'test/rbkt/Queries/zorba/math/deg-to-rad.xq' | |||
2615 | --- test/rbkt/Queries/zorba/math/deg-to-rad.xq 2013-02-07 17:24:36 +0000 | |||
2616 | +++ test/rbkt/Queries/zorba/math/deg-to-rad.xq 2013-07-17 15:56:30 +0000 | |||
2617 | @@ -1,4 +1,4 @@ | |||
2618 | 1 | (: test for bug #3079279 :) | 1 | (: test for bug #3079279 :) |
2620 | 2 | import module namespace math="http://www.zorba-xquery.com/modules/math"; | 2 | import module namespace math="http://zorba.io/modules/math"; |
2621 | 3 | 3 | ||
2622 | 4 | math:deg-to-rad(10) | 4 | math:deg-to-rad(10) |
2623 | 5 | 5 | ||
2624 | === modified file 'test/rbkt/Queries/zorba/math/fmod1.xq' | |||
2625 | --- test/rbkt/Queries/zorba/math/fmod1.xq 2013-02-07 17:24:36 +0000 | |||
2626 | +++ test/rbkt/Queries/zorba/math/fmod1.xq 2013-07-17 15:56:30 +0000 | |||
2627 | @@ -1,3 +1,3 @@ | |||
2629 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
2630 | 2 | 2 | ||
2631 | 3 | fn-zorba-math:fmod(-10, 3) | 3 | fn-zorba-math:fmod(-10, 3) |
2632 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
2633 | 5 | 5 | ||
2634 | === modified file 'test/rbkt/Queries/zorba/math/fmod2.xq' | |||
2635 | --- test/rbkt/Queries/zorba/math/fmod2.xq 2013-02-07 17:24:36 +0000 | |||
2636 | +++ test/rbkt/Queries/zorba/math/fmod2.xq 2013-07-17 15:56:30 +0000 | |||
2637 | @@ -1,3 +1,3 @@ | |||
2639 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
2640 | 2 | 2 | ||
2641 | 3 | fn-zorba-math:fmod(2.3, 1.1) | 3 | fn-zorba-math:fmod(2.3, 1.1) |
2642 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
2643 | 5 | 5 | ||
2644 | === modified file 'test/rbkt/Queries/zorba/math/fmod3.xq' | |||
2645 | --- test/rbkt/Queries/zorba/math/fmod3.xq 2013-02-07 17:24:36 +0000 | |||
2646 | +++ test/rbkt/Queries/zorba/math/fmod3.xq 2013-07-17 15:56:30 +0000 | |||
2647 | @@ -1,3 +1,3 @@ | |||
2649 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
2650 | 2 | 2 | ||
2651 | 3 | fn-zorba-math:fmod(-10, 0) | 3 | fn-zorba-math:fmod(-10, 0) |
2652 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
2653 | 5 | 5 | ||
2654 | === modified file 'test/rbkt/Queries/zorba/math/frexp1.xq' | |||
2655 | --- test/rbkt/Queries/zorba/math/frexp1.xq 2013-02-07 17:24:36 +0000 | |||
2656 | +++ test/rbkt/Queries/zorba/math/frexp1.xq 2013-07-17 15:56:30 +0000 | |||
2657 | @@ -1,3 +1,3 @@ | |||
2659 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
2660 | 2 | 2 | ||
2661 | 3 | fn-zorba-math:frexp(16.4) | 3 | fn-zorba-math:frexp(16.4) |
2662 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
2663 | 5 | 5 | ||
2664 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq' | |||
2665 | --- test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq 2013-02-07 17:24:36 +0000 | |||
2666 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_avedev1.xq 2013-07-17 15:56:30 +0000 | |||
2667 | @@ -1,4 +1,4 @@ | |||
2668 | 1 | import module namespace | 1 | import module namespace |
2670 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2671 | 3 | 3 | ||
2672 | 4 | math:avedev((4, 5, 6, 7, 5, 4, 3)) | 4 | math:avedev((4, 5, 6, 7, 5, 4, 3)) |
2673 | 5 | 5 | ||
2674 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq' | |||
2675 | --- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq 2013-02-07 17:24:36 +0000 | |||
2676 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling1.xq 2013-07-17 15:56:30 +0000 | |||
2677 | @@ -1,4 +1,4 @@ | |||
2678 | 1 | import module namespace | 1 | import module namespace |
2680 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2681 | 3 | 3 | ||
2682 | 4 | math:ceiling(2.5, 1) | 4 | math:ceiling(2.5, 1) |
2683 | 5 | 5 | ||
2684 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq' | |||
2685 | --- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq 2013-02-07 17:24:36 +0000 | |||
2686 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling2.xq 2013-07-17 15:56:30 +0000 | |||
2687 | @@ -1,4 +1,4 @@ | |||
2688 | 1 | import module namespace | 1 | import module namespace |
2690 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2691 | 3 | 3 | ||
2692 | 4 | math:ceiling(-2.5, -2) | 4 | math:ceiling(-2.5, -2) |
2693 | 5 | 5 | ||
2694 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.spec' | |||
2695 | --- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.spec 2013-02-07 17:24:36 +0000 | |||
2696 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.spec 2013-07-17 15:56:30 +0000 | |||
2697 | @@ -1,1 +1,1 @@ | |||
2699 | 1 | Error: http://www.zorba-xquery.com/modules/math:Num | 1 | Error: http://zorba.io/modules/math:INVALID_ARGUMENT |
2700 | 2 | 2 | ||
2701 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq' | |||
2702 | --- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq 2013-02-07 17:24:36 +0000 | |||
2703 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling3.xq 2013-07-17 15:56:30 +0000 | |||
2704 | @@ -1,5 +1,5 @@ | |||
2705 | 1 | import module namespace | 1 | import module namespace |
2707 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2708 | 3 | 3 | ||
2709 | 4 | math:ceiling(-2.5, 2) | 4 | math:ceiling(-2.5, 2) |
2710 | 5 | 5 | ||
2711 | 6 | 6 | ||
2712 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling4.xq' | |||
2713 | --- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling4.xq 2013-02-07 17:24:36 +0000 | |||
2714 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling4.xq 2013-07-17 15:56:30 +0000 | |||
2715 | @@ -1,4 +1,4 @@ | |||
2716 | 1 | import module namespace | 1 | import module namespace |
2718 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2719 | 3 | 3 | ||
2720 | 4 | math:ceiling(1.5, 0.1) | 4 | math:ceiling(1.5, 0.1) |
2721 | 5 | 5 | ||
2722 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling5.xq' | |||
2723 | --- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling5.xq 2013-02-07 17:24:36 +0000 | |||
2724 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling5.xq 2013-07-17 15:56:30 +0000 | |||
2725 | @@ -1,4 +1,4 @@ | |||
2726 | 1 | import module namespace | 1 | import module namespace |
2728 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2729 | 3 | 3 | ||
2730 | 4 | math:ceiling(0.234, 0.01) | 4 | math:ceiling(0.234, 0.01) |
2731 | 5 | 5 | ||
2732 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling6.xq' | |||
2733 | --- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling6.xq 2013-02-07 17:24:36 +0000 | |||
2734 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling6.xq 2013-07-17 15:56:30 +0000 | |||
2735 | @@ -1,4 +1,4 @@ | |||
2736 | 1 | import module namespace | 1 | import module namespace |
2738 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2739 | 3 | 3 | ||
2740 | 4 | math:ceiling(-20.1, -20.2) | 4 | math:ceiling(-20.1, -20.2) |
2741 | 5 | 5 | ||
2742 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq' | |||
2743 | --- test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq 2013-02-07 17:24:36 +0000 | |||
2744 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_ceiling7.xq 2013-07-17 15:56:30 +0000 | |||
2745 | @@ -1,4 +1,4 @@ | |||
2746 | 1 | import module namespace | 1 | import module namespace |
2748 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2749 | 3 | 3 | ||
2750 | 4 | math:ceiling(0.6, 5E-1) | 4 | math:ceiling(0.6, 5E-1) |
2751 | 5 | 5 | ||
2752 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even1.xq' | |||
2753 | --- test/rbkt/Queries/zorba/math/from_excel/excel_even1.xq 2013-02-07 17:24:36 +0000 | |||
2754 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_even1.xq 2013-07-17 15:56:30 +0000 | |||
2755 | @@ -1,4 +1,4 @@ | |||
2756 | 1 | import module namespace | 1 | import module namespace |
2758 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2759 | 3 | 3 | ||
2760 | 4 | math:even(1.5) | 4 | math:even(1.5) |
2761 | 5 | 5 | ||
2762 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even2.xq' | |||
2763 | --- test/rbkt/Queries/zorba/math/from_excel/excel_even2.xq 2013-02-07 17:24:36 +0000 | |||
2764 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_even2.xq 2013-07-17 15:56:30 +0000 | |||
2765 | @@ -1,4 +1,4 @@ | |||
2766 | 1 | import module namespace | 1 | import module namespace |
2768 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2769 | 3 | 3 | ||
2770 | 4 | math:even(3) | 4 | math:even(3) |
2771 | 5 | 5 | ||
2772 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even3.xq' | |||
2773 | --- test/rbkt/Queries/zorba/math/from_excel/excel_even3.xq 2013-02-07 17:24:36 +0000 | |||
2774 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_even3.xq 2013-07-17 15:56:30 +0000 | |||
2775 | @@ -1,4 +1,4 @@ | |||
2776 | 1 | import module namespace | 1 | import module namespace |
2778 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2779 | 3 | 3 | ||
2780 | 4 | math:even(2) | 4 | math:even(2) |
2781 | 5 | 5 | ||
2782 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even4.xq' | |||
2783 | --- test/rbkt/Queries/zorba/math/from_excel/excel_even4.xq 2013-02-07 17:24:36 +0000 | |||
2784 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_even4.xq 2013-07-17 15:56:30 +0000 | |||
2785 | @@ -1,4 +1,4 @@ | |||
2786 | 1 | import module namespace | 1 | import module namespace |
2788 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2789 | 3 | 3 | ||
2790 | 4 | math:even(-1) | 4 | math:even(-1) |
2791 | 5 | 5 | ||
2792 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq' | |||
2793 | --- test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq 2013-02-07 17:24:36 +0000 | |||
2794 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_even5.xq 2013-07-17 15:56:30 +0000 | |||
2795 | @@ -1,4 +1,4 @@ | |||
2796 | 1 | import module namespace | 1 | import module namespace |
2798 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2799 | 3 | 3 | ||
2800 | 4 | math:even(2.5) | 4 | math:even(2.5) |
2801 | 5 | 5 | ||
2802 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq' | |||
2803 | --- test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq 2013-02-07 17:24:36 +0000 | |||
2804 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_even6.xq 2013-07-17 15:56:30 +0000 | |||
2805 | @@ -1,4 +1,4 @@ | |||
2806 | 1 | import module namespace | 1 | import module namespace |
2808 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2809 | 3 | 3 | ||
2810 | 4 | math:even(0) | 4 | math:even(0) |
2811 | 5 | 5 | ||
2812 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq' | |||
2813 | --- test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq 2013-02-07 17:24:36 +0000 | |||
2814 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_fact1.xq 2013-07-17 15:56:30 +0000 | |||
2815 | @@ -1,4 +1,4 @@ | |||
2816 | 1 | import module namespace | 1 | import module namespace |
2818 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2819 | 3 | 3 | ||
2820 | 4 | math:fact(5) | 4 | math:fact(5) |
2821 | 5 | 5 | ||
2822 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq' | |||
2823 | --- test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq 2013-02-07 17:24:36 +0000 | |||
2824 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_fact2.xq 2013-07-17 15:56:30 +0000 | |||
2825 | @@ -1,4 +1,4 @@ | |||
2826 | 1 | import module namespace | 1 | import module namespace |
2828 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2829 | 3 | 3 | ||
2830 | 4 | math:fact(1) | 4 | math:fact(1) |
2831 | 5 | 5 | ||
2832 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq' | |||
2833 | --- test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq 2013-02-07 17:24:36 +0000 | |||
2834 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_fact3.xq 2013-07-17 15:56:30 +0000 | |||
2835 | @@ -1,4 +1,4 @@ | |||
2836 | 1 | import module namespace | 1 | import module namespace |
2838 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2839 | 3 | 3 | ||
2840 | 4 | math:fact(0) | 4 | math:fact(0) |
2841 | 5 | 5 | ||
2842 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact4.spec' | |||
2843 | --- test/rbkt/Queries/zorba/math/from_excel/excel_fact4.spec 2013-02-07 17:24:36 +0000 | |||
2844 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_fact4.spec 2013-07-17 15:56:30 +0000 | |||
2845 | @@ -1,1 +1,1 @@ | |||
2847 | 1 | Error: http://www.zorba-xquery.com/modules/math:Num | 1 | Error: http://zorba.io/modules/math:INVALID_ARGUMENT |
2848 | 2 | 2 | ||
2849 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq' | |||
2850 | --- test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq 2013-02-07 17:24:36 +0000 | |||
2851 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_fact4.xq 2013-07-17 15:56:30 +0000 | |||
2852 | @@ -1,5 +1,5 @@ | |||
2853 | 1 | import module namespace | 1 | import module namespace |
2855 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2856 | 3 | 3 | ||
2857 | 4 | math:fact(-1) | 4 | math:fact(-1) |
2858 | 5 | 5 | ||
2859 | 6 | 6 | ||
2860 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq' | |||
2861 | --- test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq 2013-02-07 17:24:36 +0000 | |||
2862 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_fact5.xq 2013-07-17 15:56:30 +0000 | |||
2863 | @@ -1,4 +1,4 @@ | |||
2864 | 1 | import module namespace | 1 | import module namespace |
2866 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2867 | 3 | 3 | ||
2868 | 4 | math:fact(1) | 4 | math:fact(1) |
2869 | 5 | 5 | ||
2870 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq' | |||
2871 | --- test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq 2013-02-07 17:24:36 +0000 | |||
2872 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_factdouble1.xq 2013-07-17 15:56:30 +0000 | |||
2873 | @@ -1,4 +1,4 @@ | |||
2874 | 1 | import module namespace | 1 | import module namespace |
2876 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2877 | 3 | 3 | ||
2878 | 4 | math:factdouble(6) | 4 | math:factdouble(6) |
2879 | 5 | 5 | ||
2880 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq' | |||
2881 | --- test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq 2013-02-07 17:24:36 +0000 | |||
2882 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_factdouble2.xq 2013-07-17 15:56:30 +0000 | |||
2883 | @@ -1,4 +1,4 @@ | |||
2884 | 1 | import module namespace | 1 | import module namespace |
2886 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2887 | 3 | 3 | ||
2888 | 4 | math:factdouble(7) | 4 | math:factdouble(7) |
2889 | 5 | 5 | ||
2890 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq' | |||
2891 | --- test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq 2013-02-07 17:24:36 +0000 | |||
2892 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_floor1.xq 2013-07-17 15:56:30 +0000 | |||
2893 | @@ -1,4 +1,4 @@ | |||
2894 | 1 | import module namespace | 1 | import module namespace |
2896 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2897 | 3 | 3 | ||
2898 | 4 | math:floor(2.5, 1) | 4 | math:floor(2.5, 1) |
2899 | 5 | 5 | ||
2900 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq' | |||
2901 | --- test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq 2013-02-07 17:24:36 +0000 | |||
2902 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_floor2.xq 2013-07-17 15:56:30 +0000 | |||
2903 | @@ -1,4 +1,4 @@ | |||
2904 | 1 | import module namespace | 1 | import module namespace |
2906 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2907 | 3 | 3 | ||
2908 | 4 | math:floor(-2.5, -2) | 4 | math:floor(-2.5, -2) |
2909 | 5 | 5 | ||
2910 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor3.spec' | |||
2911 | --- test/rbkt/Queries/zorba/math/from_excel/excel_floor3.spec 2013-02-07 17:24:36 +0000 | |||
2912 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_floor3.spec 2013-07-17 15:56:30 +0000 | |||
2913 | @@ -1,1 +1,1 @@ | |||
2915 | 1 | Error: http://www.zorba-xquery.com/modules/math:Num | 1 | Error: http://zorba.io/modules/math:INVALID_ARGUMENT |
2916 | 2 | 2 | ||
2917 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq' | |||
2918 | --- test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq 2013-02-07 17:24:36 +0000 | |||
2919 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_floor3.xq 2013-07-17 15:56:30 +0000 | |||
2920 | @@ -1,5 +1,5 @@ | |||
2921 | 1 | import module namespace | 1 | import module namespace |
2923 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2924 | 3 | 3 | ||
2925 | 4 | math:floor(-2.5, 2) | 4 | math:floor(-2.5, 2) |
2926 | 5 | 5 | ||
2927 | 6 | 6 | ||
2928 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor4.xq' | |||
2929 | --- test/rbkt/Queries/zorba/math/from_excel/excel_floor4.xq 2013-02-07 17:24:36 +0000 | |||
2930 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_floor4.xq 2013-07-17 15:56:30 +0000 | |||
2931 | @@ -1,4 +1,4 @@ | |||
2932 | 1 | import module namespace | 1 | import module namespace |
2934 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2935 | 3 | 3 | ||
2936 | 4 | math:floor(1.5, 0.1) | 4 | math:floor(1.5, 0.1) |
2937 | 5 | 5 | ||
2938 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq' | |||
2939 | --- test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq 2013-02-07 17:24:36 +0000 | |||
2940 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_floor5.xq 2013-07-17 15:56:30 +0000 | |||
2941 | @@ -1,4 +1,4 @@ | |||
2942 | 1 | import module namespace | 1 | import module namespace |
2944 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2945 | 3 | 3 | ||
2946 | 4 | math:floor(0.234, 0.01) | 4 | math:floor(0.234, 0.01) |
2947 | 5 | 5 | ||
2948 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_floor6.xq' | |||
2949 | --- test/rbkt/Queries/zorba/math/from_excel/excel_floor6.xq 2013-02-07 17:24:36 +0000 | |||
2950 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_floor6.xq 2013-07-17 15:56:30 +0000 | |||
2951 | @@ -1,4 +1,4 @@ | |||
2952 | 1 | import module namespace | 1 | import module namespace |
2954 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2955 | 3 | 3 | ||
2956 | 4 | (1.31 - math:floor(1.31, 0.2)) ge 0.1 | 4 | (1.31 - math:floor(1.31, 0.2)) ge 0.1 |
2957 | 5 | 5 | ||
2958 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq' | |||
2959 | --- test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq 2013-02-07 17:24:36 +0000 | |||
2960 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd1.xq 2013-07-17 15:56:30 +0000 | |||
2961 | @@ -1,4 +1,4 @@ | |||
2962 | 1 | import module namespace | 1 | import module namespace |
2964 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2965 | 3 | 3 | ||
2966 | 4 | math:gcd((5, 2)) | 4 | math:gcd((5, 2)) |
2967 | 5 | 5 | ||
2968 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq' | |||
2969 | --- test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq 2013-02-07 17:24:36 +0000 | |||
2970 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd2.xq 2013-07-17 15:56:30 +0000 | |||
2971 | @@ -1,4 +1,4 @@ | |||
2972 | 1 | import module namespace | 1 | import module namespace |
2974 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2975 | 3 | 3 | ||
2976 | 4 | math:gcd((24, 36)) | 4 | math:gcd((24, 36)) |
2977 | 5 | 5 | ||
2978 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq' | |||
2979 | --- test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq 2013-02-07 17:24:36 +0000 | |||
2980 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd3.xq 2013-07-17 15:56:30 +0000 | |||
2981 | @@ -1,4 +1,4 @@ | |||
2982 | 1 | import module namespace | 1 | import module namespace |
2984 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2985 | 3 | 3 | ||
2986 | 4 | math:gcd((7, 1)) | 4 | math:gcd((7, 1)) |
2987 | 5 | 5 | ||
2988 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd4.xq' | |||
2989 | --- test/rbkt/Queries/zorba/math/from_excel/excel_gcd4.xq 2013-02-07 17:24:36 +0000 | |||
2990 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd4.xq 2013-07-17 15:56:30 +0000 | |||
2991 | @@ -1,4 +1,4 @@ | |||
2992 | 1 | import module namespace | 1 | import module namespace |
2994 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
2995 | 3 | 3 | ||
2996 | 4 | math:gcd((5, 0)) | 4 | math:gcd((5, 0)) |
2997 | 5 | 5 | ||
2998 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd5.xq' | |||
2999 | --- test/rbkt/Queries/zorba/math/from_excel/excel_gcd5.xq 2013-02-07 17:24:36 +0000 | |||
3000 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd5.xq 2013-07-17 15:56:30 +0000 | |||
3001 | @@ -1,4 +1,4 @@ | |||
3002 | 1 | import module namespace | 1 | import module namespace |
3004 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3005 | 3 | 3 | ||
3006 | 4 | math:gcd((13, 17, 23, 29)) | 4 | math:gcd((13, 17, 23, 29)) |
3007 | 5 | 5 | ||
3008 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.spec' | |||
3009 | --- test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.spec 2013-02-07 17:24:36 +0000 | |||
3010 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.spec 2013-07-17 15:56:30 +0000 | |||
3011 | @@ -1,1 +1,1 @@ | |||
3013 | 1 | Error: http://www.zorba-xquery.com/modules/math:Num | 1 | Error: http://zorba.io/modules/math:INVALID_ARGUMENT |
3014 | 2 | 2 | ||
3015 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.xq' | |||
3016 | --- test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.xq 2013-02-07 17:24:36 +0000 | |||
3017 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd6.xq 2013-07-17 15:56:30 +0000 | |||
3018 | @@ -1,5 +1,5 @@ | |||
3019 | 1 | import module namespace | 1 | import module namespace |
3021 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3022 | 3 | 3 | ||
3023 | 4 | math:gcd((-5, 0, 2)) | 4 | math:gcd((-5, 0, 2)) |
3024 | 5 | 5 | ||
3025 | 6 | 6 | ||
3026 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq' | |||
3027 | --- test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq 2013-02-07 17:24:36 +0000 | |||
3028 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd7.xq 2013-07-17 15:56:30 +0000 | |||
3029 | @@ -1,4 +1,4 @@ | |||
3030 | 1 | import module namespace | 1 | import module namespace |
3032 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3033 | 3 | 3 | ||
3034 | 4 | math:gcd((3)) | 4 | math:gcd((3)) |
3035 | 5 | 5 | ||
3036 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq' | |||
3037 | --- test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq 2013-02-07 17:24:36 +0000 | |||
3038 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_gcd8.xq 2013-07-17 15:56:30 +0000 | |||
3039 | @@ -1,4 +1,4 @@ | |||
3040 | 1 | import module namespace | 1 | import module namespace |
3042 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3043 | 3 | 3 | ||
3044 | 4 | math:gcd((6, 12, 15)) | 4 | math:gcd((6, 12, 15)) |
3045 | 5 | 5 | ||
3046 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_int1.xq' | |||
3047 | --- test/rbkt/Queries/zorba/math/from_excel/excel_int1.xq 2013-02-07 17:24:36 +0000 | |||
3048 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_int1.xq 2013-07-17 15:56:30 +0000 | |||
3049 | @@ -1,4 +1,4 @@ | |||
3050 | 1 | import module namespace | 1 | import module namespace |
3052 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3053 | 3 | 3 | ||
3054 | 4 | math:int(8.9) | 4 | math:int(8.9) |
3055 | 5 | 5 | ||
3056 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_int2.xq' | |||
3057 | --- test/rbkt/Queries/zorba/math/from_excel/excel_int2.xq 2013-02-07 17:24:36 +0000 | |||
3058 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_int2.xq 2013-07-17 15:56:30 +0000 | |||
3059 | @@ -1,4 +1,4 @@ | |||
3060 | 1 | import module namespace | 1 | import module namespace |
3062 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3063 | 3 | 3 | ||
3064 | 4 | math:int(-8.9) | 4 | math:int(-8.9) |
3065 | 5 | 5 | ||
3066 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq' | |||
3067 | --- test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq 2013-02-07 17:24:36 +0000 | |||
3068 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_int3.xq 2013-07-17 15:56:30 +0000 | |||
3069 | @@ -1,4 +1,4 @@ | |||
3070 | 1 | import module namespace | 1 | import module namespace |
3072 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3073 | 3 | 3 | ||
3074 | 4 | math:int(19.5) | 4 | math:int(19.5) |
3075 | 5 | 5 | ||
3076 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq' | |||
3077 | --- test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq 2013-02-07 17:24:36 +0000 | |||
3078 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_int4.xq 2013-07-17 15:56:30 +0000 | |||
3079 | @@ -1,4 +1,4 @@ | |||
3080 | 1 | import module namespace | 1 | import module namespace |
3082 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3083 | 3 | 3 | ||
3084 | 4 | math:int(-4.3) | 4 | math:int(-4.3) |
3085 | 5 | 5 | ||
3086 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq' | |||
3087 | --- test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq 2013-02-07 17:24:36 +0000 | |||
3088 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_large1.xq 2013-07-17 15:56:30 +0000 | |||
3089 | @@ -1,5 +1,5 @@ | |||
3090 | 1 | import module namespace | 1 | import module namespace |
3092 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3093 | 3 | 3 | ||
3094 | 4 | math:large((), 1) | 4 | math:large((), 1) |
3095 | 5 | 5 | ||
3096 | 6 | 6 | ||
3097 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq' | |||
3098 | --- test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq 2013-02-07 17:24:36 +0000 | |||
3099 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_large2.xq 2013-07-17 15:56:30 +0000 | |||
3100 | @@ -1,4 +1,4 @@ | |||
3101 | 1 | import module namespace | 1 | import module namespace |
3103 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3104 | 3 | 3 | ||
3105 | 4 | math:large((3, 4, 5, 2, 3, 4, 5, 6, 4, 7), 3) | 4 | math:large((3, 4, 5, 2, 3, 4, 5, 6, 4, 7), 3) |
3106 | 5 | 5 | ||
3107 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq' | |||
3108 | --- test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq 2013-02-07 17:24:36 +0000 | |||
3109 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_large3.xq 2013-07-17 15:56:30 +0000 | |||
3110 | @@ -1,4 +1,4 @@ | |||
3111 | 1 | import module namespace | 1 | import module namespace |
3113 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3114 | 3 | 3 | ||
3115 | 4 | math:large((3, 4, 5, 2, 3, 4, 5, 6, 4, 7), 7 ) | 4 | math:large((3, 4, 5, 2, 3, 4, 5, 6, 4, 7), 7 ) |
3116 | 5 | 5 | ||
3117 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq' | |||
3118 | --- test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq 2013-02-07 17:24:36 +0000 | |||
3119 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_lcm1.xq 2013-07-17 15:56:30 +0000 | |||
3120 | @@ -1,4 +1,4 @@ | |||
3121 | 1 | import module namespace | 1 | import module namespace |
3123 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3124 | 3 | 3 | ||
3125 | 4 | math:lcm((5,2)) | 4 | math:lcm((5,2)) |
3126 | 5 | 5 | ||
3127 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq' | |||
3128 | --- test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq 2013-02-07 17:24:36 +0000 | |||
3129 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_lcm2.xq 2013-07-17 15:56:30 +0000 | |||
3130 | @@ -1,4 +1,4 @@ | |||
3131 | 1 | import module namespace | 1 | import module namespace |
3133 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3134 | 3 | 3 | ||
3135 | 4 | math:lcm((24, 36)) | 4 | math:lcm((24, 36)) |
3136 | 5 | 5 | ||
3137 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq' | |||
3138 | --- test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq 2013-02-07 17:24:36 +0000 | |||
3139 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_lcm3.xq 2013-07-17 15:56:30 +0000 | |||
3140 | @@ -1,4 +1,4 @@ | |||
3141 | 1 | import module namespace | 1 | import module namespace |
3143 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3144 | 3 | 3 | ||
3145 | 4 | math:lcm((5,0)) | 4 | math:lcm((5,0)) |
3146 | 5 | 5 | ||
3147 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq' | |||
3148 | --- test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq 2013-02-07 17:24:36 +0000 | |||
3149 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_lcm4.xq 2013-07-17 15:56:30 +0000 | |||
3150 | @@ -1,4 +1,4 @@ | |||
3151 | 1 | import module namespace | 1 | import module namespace |
3153 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3154 | 3 | 3 | ||
3155 | 4 | math:lcm((2, 4, 8)) | 4 | math:lcm((2, 4, 8)) |
3156 | 5 | 5 | ||
3157 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq' | |||
3158 | --- test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq 2013-02-07 17:24:36 +0000 | |||
3159 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_lcm5.xq 2013-07-17 15:56:30 +0000 | |||
3160 | @@ -1,4 +1,4 @@ | |||
3161 | 1 | import module namespace | 1 | import module namespace |
3163 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3164 | 3 | 3 | ||
3165 | 4 | math:lcm((11, 12, 13)) | 4 | math:lcm((11, 12, 13)) |
3166 | 5 | 5 | ||
3167 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq' | |||
3168 | --- test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq 2013-02-07 17:24:36 +0000 | |||
3169 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_median1.xq 2013-07-17 15:56:30 +0000 | |||
3170 | @@ -1,4 +1,4 @@ | |||
3171 | 1 | import module namespace | 1 | import module namespace |
3173 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3174 | 3 | 3 | ||
3175 | 4 | math:median((1, 3, 4, 2, 5)) | 4 | math:median((1, 3, 4, 2, 5)) |
3176 | 5 | 5 | ||
3177 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq' | |||
3178 | --- test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq 2013-02-07 17:24:36 +0000 | |||
3179 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_median2.xq 2013-07-17 15:56:30 +0000 | |||
3180 | @@ -1,4 +1,4 @@ | |||
3181 | 1 | import module namespace | 1 | import module namespace |
3183 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3184 | 3 | 3 | ||
3185 | 4 | math:median((1, 3, 4, 2)) | 4 | math:median((1, 3, 4, 2)) |
3186 | 5 | 5 | ||
3187 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq' | |||
3188 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq 2013-02-07 17:24:36 +0000 | |||
3189 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mod1.xq 2013-07-17 15:56:30 +0000 | |||
3190 | @@ -1,4 +1,4 @@ | |||
3191 | 1 | import module namespace | 1 | import module namespace |
3193 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3194 | 3 | 3 | ||
3195 | 4 | math:mod(3,2) | 4 | math:mod(3,2) |
3196 | 5 | 5 | ||
3197 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq' | |||
3198 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq 2013-02-07 17:24:36 +0000 | |||
3199 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mod2.xq 2013-07-17 15:56:30 +0000 | |||
3200 | @@ -1,4 +1,4 @@ | |||
3201 | 1 | import module namespace | 1 | import module namespace |
3203 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3204 | 3 | 3 | ||
3205 | 4 | math:mod(-3,2) | 4 | math:mod(-3,2) |
3206 | 5 | 5 | ||
3207 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq' | |||
3208 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq 2013-02-07 17:24:36 +0000 | |||
3209 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mod3.xq 2013-07-17 15:56:30 +0000 | |||
3210 | @@ -1,4 +1,4 @@ | |||
3211 | 1 | import module namespace | 1 | import module namespace |
3213 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3214 | 3 | 3 | ||
3215 | 4 | math:mod(3,-2) | 4 | math:mod(3,-2) |
3216 | 5 | 5 | ||
3217 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq' | |||
3218 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq 2013-02-07 17:24:36 +0000 | |||
3219 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mod4.xq 2013-07-17 15:56:30 +0000 | |||
3220 | @@ -1,4 +1,4 @@ | |||
3221 | 1 | import module namespace | 1 | import module namespace |
3223 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3224 | 3 | 3 | ||
3225 | 4 | math:mod(-3,-2) | 4 | math:mod(-3,-2) |
3226 | 5 | 5 | ||
3227 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mode1.spec' | |||
3228 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mode1.spec 2013-02-07 17:24:36 +0000 | |||
3229 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mode1.spec 2013-07-17 15:56:30 +0000 | |||
3230 | @@ -1,1 +1,1 @@ | |||
3232 | 1 | Error: http://www.zorba-xquery.com/modules/math:NA | 1 | Error: http://zorba.io/modules/math:INVALID_INPUT |
3233 | 2 | 2 | ||
3234 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq' | |||
3235 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq 2013-02-07 17:24:36 +0000 | |||
3236 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mode1.xq 2013-07-17 15:56:30 +0000 | |||
3237 | @@ -1,5 +1,5 @@ | |||
3238 | 1 | import module namespace | 1 | import module namespace |
3240 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3241 | 3 | 3 | ||
3242 | 4 | math:mode((1, 3, 4, 2, 5)) | 4 | math:mode((1, 3, 4, 2, 5)) |
3243 | 5 | 5 | ||
3244 | 6 | 6 | ||
3245 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq' | |||
3246 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq 2013-02-07 17:24:36 +0000 | |||
3247 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mode2.xq 2013-07-17 15:56:30 +0000 | |||
3248 | @@ -1,5 +1,5 @@ | |||
3249 | 1 | import module namespace | 1 | import module namespace |
3251 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3252 | 3 | 3 | ||
3253 | 4 | math:mode((1, 3, 4, 2, "l")) | 4 | math:mode((1, 3, 4, 2, "l")) |
3254 | 5 | 5 | ||
3255 | 6 | 6 | ||
3256 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq' | |||
3257 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq 2013-02-07 17:24:36 +0000 | |||
3258 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mode3.xq 2013-07-17 15:56:30 +0000 | |||
3259 | @@ -1,4 +1,4 @@ | |||
3260 | 1 | import module namespace | 1 | import module namespace |
3262 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3263 | 3 | 3 | ||
3264 | 4 | math:mode((1, 3, 4, 3, 2, 2, 5, 3, 5)) | 4 | math:mode((1, 3, 4, 3, 2, 2, 5, 3, 5)) |
3265 | 5 | 5 | ||
3266 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mround1.xq' | |||
3267 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mround1.xq 2013-02-07 17:24:36 +0000 | |||
3268 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mround1.xq 2013-07-17 15:56:30 +0000 | |||
3269 | @@ -1,4 +1,4 @@ | |||
3270 | 1 | import module namespace | 1 | import module namespace |
3272 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3273 | 3 | 3 | ||
3274 | 4 | math:mround(10, 3) | 4 | math:mround(10, 3) |
3275 | 5 | 5 | ||
3276 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mround2.xq' | |||
3277 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mround2.xq 2013-02-07 17:24:36 +0000 | |||
3278 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mround2.xq 2013-07-17 15:56:30 +0000 | |||
3279 | @@ -1,4 +1,4 @@ | |||
3280 | 1 | import module namespace | 1 | import module namespace |
3282 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3283 | 3 | 3 | ||
3284 | 4 | math:mround(-10, -3) | 4 | math:mround(-10, -3) |
3285 | 5 | 5 | ||
3286 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq' | |||
3287 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq 2013-02-07 17:24:36 +0000 | |||
3288 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mround3.xq 2013-07-17 15:56:30 +0000 | |||
3289 | @@ -1,4 +1,4 @@ | |||
3290 | 1 | import module namespace | 1 | import module namespace |
3292 | 2 | zorba-math="http://www.zorba-xquery.com/modules/math"; | 2 | zorba-math="http://zorba.io/modules/math"; |
3293 | 3 | 3 | ||
3294 | 4 | zorba-math:mround(1.3, 0.2) | 4 | zorba-math:mround(1.3, 0.2) |
3295 | 5 | 5 | ||
3296 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_mround4.xq' | |||
3297 | --- test/rbkt/Queries/zorba/math/from_excel/excel_mround4.xq 2013-02-07 17:24:36 +0000 | |||
3298 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_mround4.xq 2013-07-17 15:56:30 +0000 | |||
3299 | @@ -1,4 +1,4 @@ | |||
3300 | 1 | import module namespace | 1 | import module namespace |
3302 | 2 | zorba-math="http://www.zorba-xquery.com/modules/math"; | 2 | zorba-math="http://zorba.io/modules/math"; |
3303 | 3 | 3 | ||
3304 | 4 | zorba-math:mround(-1.3, -0.2) | 4 | zorba-math:mround(-1.3, -0.2) |
3305 | 5 | 5 | ||
3306 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd1.xq' | |||
3307 | --- test/rbkt/Queries/zorba/math/from_excel/excel_odd1.xq 2013-02-07 17:24:36 +0000 | |||
3308 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_odd1.xq 2013-07-17 15:56:30 +0000 | |||
3309 | @@ -1,4 +1,4 @@ | |||
3310 | 1 | import module namespace | 1 | import module namespace |
3312 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3313 | 3 | 3 | ||
3314 | 4 | math:odd(1.5) | 4 | math:odd(1.5) |
3315 | 5 | 5 | ||
3316 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd2.xq' | |||
3317 | --- test/rbkt/Queries/zorba/math/from_excel/excel_odd2.xq 2013-02-07 17:24:36 +0000 | |||
3318 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_odd2.xq 2013-07-17 15:56:30 +0000 | |||
3319 | @@ -1,4 +1,4 @@ | |||
3320 | 1 | import module namespace | 1 | import module namespace |
3322 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3323 | 3 | 3 | ||
3324 | 4 | math:odd(3) | 4 | math:odd(3) |
3325 | 5 | 5 | ||
3326 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd3.xq' | |||
3327 | --- test/rbkt/Queries/zorba/math/from_excel/excel_odd3.xq 2013-02-07 17:24:36 +0000 | |||
3328 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_odd3.xq 2013-07-17 15:56:30 +0000 | |||
3329 | @@ -1,4 +1,4 @@ | |||
3330 | 1 | import module namespace | 1 | import module namespace |
3332 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3333 | 3 | 3 | ||
3334 | 4 | math:odd(2) | 4 | math:odd(2) |
3335 | 5 | 5 | ||
3336 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd4.xq' | |||
3337 | --- test/rbkt/Queries/zorba/math/from_excel/excel_odd4.xq 2013-02-07 17:24:36 +0000 | |||
3338 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_odd4.xq 2013-07-17 15:56:30 +0000 | |||
3339 | @@ -1,4 +1,4 @@ | |||
3340 | 1 | import module namespace | 1 | import module namespace |
3342 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3343 | 3 | 3 | ||
3344 | 4 | math:odd(-1) | 4 | math:odd(-1) |
3345 | 5 | 5 | ||
3346 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq' | |||
3347 | --- test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq 2013-02-07 17:24:36 +0000 | |||
3348 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_odd5.xq 2013-07-17 15:56:30 +0000 | |||
3349 | @@ -1,4 +1,4 @@ | |||
3350 | 1 | import module namespace | 1 | import module namespace |
3352 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3353 | 3 | 3 | ||
3354 | 4 | math:odd(-2) | 4 | math:odd(-2) |
3355 | 5 | 5 | ||
3356 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq' | |||
3357 | --- test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq 2013-02-07 17:24:36 +0000 | |||
3358 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_odd6.xq 2013-07-17 15:56:30 +0000 | |||
3359 | @@ -1,4 +1,4 @@ | |||
3360 | 1 | import module namespace | 1 | import module namespace |
3362 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3363 | 3 | 3 | ||
3364 | 4 | math:odd(0) | 4 | math:odd(0) |
3365 | 5 | 5 | ||
3366 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq' | |||
3367 | --- test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq 2013-02-07 17:24:36 +0000 | |||
3368 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_percentile1.xq 2013-07-17 15:56:30 +0000 | |||
3369 | @@ -1,4 +1,4 @@ | |||
3370 | 1 | import module namespace | 1 | import module namespace |
3372 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3373 | 3 | 3 | ||
3374 | 4 | math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 1) | 4 | math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 1) |
3375 | 5 | 5 | ||
3376 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq' | |||
3377 | --- test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq 2013-02-07 17:24:36 +0000 | |||
3378 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_percentile2.xq 2013-07-17 15:56:30 +0000 | |||
3379 | @@ -1,4 +1,4 @@ | |||
3380 | 1 | import module namespace | 1 | import module namespace |
3382 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3383 | 3 | 3 | ||
3384 | 4 | math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 0.5) | 4 | math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 0.5) |
3385 | 5 | 5 | ||
3386 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.spec' | |||
3387 | --- test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.spec 2013-02-07 17:24:36 +0000 | |||
3388 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.spec 2013-07-17 15:56:30 +0000 | |||
3389 | @@ -1,1 +1,1 @@ | |||
3391 | 1 | Error: http://www.zorba-xquery.com/modules/math:Num | 1 | Error: http://zorba.io/modules/math:INVALID_ARGUMENT |
3392 | 2 | 2 | ||
3393 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq' | |||
3394 | --- test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq 2013-02-07 17:24:36 +0000 | |||
3395 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_percentile3.xq 2013-07-17 15:56:30 +0000 | |||
3396 | @@ -1,5 +1,5 @@ | |||
3397 | 1 | import module namespace | 1 | import module namespace |
3399 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3400 | 3 | 3 | ||
3401 | 4 | math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 5) | 4 | math:percentile((1, 3, 4, 3, 2, 2, 5, 3, 5), 5) |
3402 | 5 | 5 | ||
3403 | 6 | 6 | ||
3404 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq' | |||
3405 | --- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq 2013-02-07 17:24:36 +0000 | |||
3406 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank1.xq 2013-07-17 15:56:30 +0000 | |||
3407 | @@ -1,4 +1,4 @@ | |||
3408 | 1 | import module namespace | 1 | import module namespace |
3410 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3411 | 3 | 3 | ||
3412 | 4 | math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 2) | 4 | math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 2) |
3413 | 5 | 5 | ||
3414 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq' | |||
3415 | --- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq 2013-02-07 17:24:36 +0000 | |||
3416 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank2.xq 2013-07-17 15:56:30 +0000 | |||
3417 | @@ -1,4 +1,4 @@ | |||
3418 | 1 | import module namespace | 1 | import module namespace |
3420 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3421 | 3 | 3 | ||
3422 | 4 | math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 4) | 4 | math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 4) |
3423 | 5 | 5 | ||
3424 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq' | |||
3425 | --- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq 2013-02-07 17:24:36 +0000 | |||
3426 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank3.xq 2013-07-17 15:56:30 +0000 | |||
3427 | @@ -1,4 +1,4 @@ | |||
3428 | 1 | import module namespace | 1 | import module namespace |
3430 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3431 | 3 | 3 | ||
3432 | 4 | math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 8) | 4 | math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 8) |
3433 | 5 | 5 | ||
3434 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq' | |||
3435 | --- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq 2013-02-07 17:24:36 +0000 | |||
3436 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank4.xq 2013-07-17 15:56:30 +0000 | |||
3437 | @@ -1,4 +1,4 @@ | |||
3438 | 1 | import module namespace | 1 | import module namespace |
3440 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3441 | 3 | 3 | ||
3442 | 4 | math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 5) | 4 | math:percentrank((13, 12, 11, 8, 4, 3, 2, 1, 1, 1), 5) |
3443 | 5 | 5 | ||
3444 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.spec' | |||
3445 | --- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.spec 2013-02-07 17:24:36 +0000 | |||
3446 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.spec 2013-07-17 15:56:30 +0000 | |||
3447 | @@ -1,1 +1,1 @@ | |||
3449 | 1 | Error: http://www.zorba-xquery.com/modules/math:Num | 1 | Error: http://zorba.io/modules/math:INVALID_ARGUMENT |
3450 | 2 | 2 | ||
3451 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq' | |||
3452 | --- test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq 2013-02-07 17:24:36 +0000 | |||
3453 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_percentrank5.xq 2013-07-17 15:56:30 +0000 | |||
3454 | @@ -1,5 +1,5 @@ | |||
3455 | 1 | import module namespace | 1 | import module namespace |
3457 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3458 | 3 | 3 | ||
3459 | 4 | math:percentrank((), 2) | 4 | math:percentrank((), 2) |
3460 | 5 | 5 | ||
3461 | 6 | 6 | ||
3462 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq' | |||
3463 | --- test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq 2013-02-07 17:24:36 +0000 | |||
3464 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_prob1.xq 2013-07-17 15:56:30 +0000 | |||
3465 | @@ -1,4 +1,4 @@ | |||
3466 | 1 | import module namespace | 1 | import module namespace |
3468 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3469 | 3 | 3 | ||
3470 | 4 | math:prob((0, 1, 2, 3), (0.2, 0.3, 0.1, 0.4), 2) | 4 | math:prob((0, 1, 2, 3), (0.2, 0.3, 0.1, 0.4), 2) |
3471 | 5 | 5 | ||
3472 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq' | |||
3473 | --- test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq 2013-02-07 17:24:36 +0000 | |||
3474 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_prob2.xq 2013-07-17 15:56:30 +0000 | |||
3475 | @@ -1,4 +1,4 @@ | |||
3476 | 1 | import module namespace | 1 | import module namespace |
3478 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3479 | 3 | 3 | ||
3480 | 4 | math:prob((0, 1, 2, 3), (0.2, 0.3, 0.1, 0.4), 1, 3) | 4 | math:prob((0, 1, 2, 3), (0.2, 0.3, 0.1, 0.4), 1, 3) |
3481 | 5 | 5 | ||
3482 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_product1.xq' | |||
3483 | --- test/rbkt/Queries/zorba/math/from_excel/excel_product1.xq 2013-02-07 17:24:36 +0000 | |||
3484 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_product1.xq 2013-07-17 15:56:30 +0000 | |||
3485 | @@ -1,4 +1,4 @@ | |||
3486 | 1 | import module namespace | 1 | import module namespace |
3488 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3489 | 3 | 3 | ||
3490 | 4 | math:product((2, 0.5)) | 4 | math:product((2, 0.5)) |
3491 | 5 | \ No newline at end of file | 5 | \ No newline at end of file |
3492 | 6 | 6 | ||
3493 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_product2.xq' | |||
3494 | --- test/rbkt/Queries/zorba/math/from_excel/excel_product2.xq 2013-02-07 17:24:36 +0000 | |||
3495 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_product2.xq 2013-07-17 15:56:30 +0000 | |||
3496 | @@ -1,4 +1,4 @@ | |||
3497 | 1 | import module namespace | 1 | import module namespace |
3499 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3500 | 3 | 3 | ||
3501 | 4 | math:product((5, 15, 30, 0)) | 4 | math:product((5, 15, 30, 0)) |
3502 | 5 | 5 | ||
3503 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_product3.xq' | |||
3504 | --- test/rbkt/Queries/zorba/math/from_excel/excel_product3.xq 2013-02-07 17:24:36 +0000 | |||
3505 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_product3.xq 2013-07-17 15:56:30 +0000 | |||
3506 | @@ -1,4 +1,4 @@ | |||
3507 | 1 | import module namespace | 1 | import module namespace |
3509 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3510 | 3 | 3 | ||
3511 | 4 | math:product((5, 15, 30, -1)) | 4 | math:product((5, 15, 30, -1)) |
3512 | 5 | 5 | ||
3513 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq' | |||
3514 | --- test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq 2013-02-07 17:24:36 +0000 | |||
3515 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_product4.xq 2013-07-17 15:56:30 +0000 | |||
3516 | @@ -1,5 +1,5 @@ | |||
3517 | 1 | import module namespace | 1 | import module namespace |
3519 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3520 | 3 | 3 | ||
3521 | 4 | math:product((5, 15, 30, "POP")) | 4 | math:product((5, 15, 30, "POP")) |
3522 | 5 | 5 | ||
3523 | 6 | 6 | ||
3524 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq' | |||
3525 | --- test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq 2013-02-07 17:24:36 +0000 | |||
3526 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_product5.xq 2013-07-17 15:56:30 +0000 | |||
3527 | @@ -1,4 +1,4 @@ | |||
3528 | 1 | import module namespace | 1 | import module namespace |
3530 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3531 | 3 | 3 | ||
3532 | 4 | math:product(()) | 4 | math:product(()) |
3533 | 5 | 5 | ||
3534 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq' | |||
3535 | --- test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq 2013-02-07 17:24:36 +0000 | |||
3536 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_quartile1.xq 2013-07-17 15:56:30 +0000 | |||
3537 | @@ -1,4 +1,4 @@ | |||
3538 | 1 | import module namespace | 1 | import module namespace |
3540 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3541 | 3 | 3 | ||
3542 | 4 | math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 0) | 4 | math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 0) |
3543 | 5 | 5 | ||
3544 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq' | |||
3545 | --- test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq 2013-02-07 17:24:36 +0000 | |||
3546 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_quartile2.xq 2013-07-17 15:56:30 +0000 | |||
3547 | @@ -1,4 +1,4 @@ | |||
3548 | 1 | import module namespace | 1 | import module namespace |
3550 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3551 | 3 | 3 | ||
3552 | 4 | math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 1) | 4 | math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 1) |
3553 | 5 | 5 | ||
3554 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq' | |||
3555 | --- test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq 2013-02-07 17:24:36 +0000 | |||
3556 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_quartile3.xq 2013-07-17 15:56:30 +0000 | |||
3557 | @@ -1,4 +1,4 @@ | |||
3558 | 1 | import module namespace | 1 | import module namespace |
3560 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3561 | 3 | 3 | ||
3562 | 4 | math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 2) | 4 | math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 2) |
3563 | 5 | 5 | ||
3564 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq' | |||
3565 | --- test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq 2013-02-07 17:24:36 +0000 | |||
3566 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_quartile4.xq 2013-07-17 15:56:30 +0000 | |||
3567 | @@ -1,4 +1,4 @@ | |||
3568 | 1 | import module namespace | 1 | import module namespace |
3570 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3571 | 3 | 3 | ||
3572 | 4 | math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 3) | 4 | math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 3) |
3573 | 5 | 5 | ||
3574 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq' | |||
3575 | --- test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq 2013-02-07 17:24:36 +0000 | |||
3576 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_quartile5.xq 2013-07-17 15:56:30 +0000 | |||
3577 | @@ -1,4 +1,4 @@ | |||
3578 | 1 | import module namespace | 1 | import module namespace |
3580 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3581 | 3 | 3 | ||
3582 | 4 | math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 4) | 4 | math:quartile((1, 2, 4, 7, 8, 9, 10, 12), 4) |
3583 | 5 | 5 | ||
3584 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq' | |||
3585 | --- test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq 2013-02-07 17:24:36 +0000 | |||
3586 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_quotient1.xq 2013-07-17 15:56:30 +0000 | |||
3587 | @@ -1,4 +1,4 @@ | |||
3588 | 1 | import module namespace | 1 | import module namespace |
3590 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3591 | 3 | 3 | ||
3592 | 4 | math:quotient(5,2) | 4 | math:quotient(5,2) |
3593 | 5 | 5 | ||
3594 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq' | |||
3595 | --- test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq 2013-02-07 17:24:36 +0000 | |||
3596 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_quotient2.xq 2013-07-17 15:56:30 +0000 | |||
3597 | @@ -1,4 +1,4 @@ | |||
3598 | 1 | import module namespace | 1 | import module namespace |
3600 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3601 | 3 | 3 | ||
3602 | 4 | math:quotient(4.5, 3.1) | 4 | math:quotient(4.5, 3.1) |
3603 | 5 | 5 | ||
3604 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq' | |||
3605 | --- test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq 2013-02-07 17:24:36 +0000 | |||
3606 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_quotient3.xq 2013-07-17 15:56:30 +0000 | |||
3607 | @@ -1,4 +1,4 @@ | |||
3608 | 1 | import module namespace | 1 | import module namespace |
3610 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3611 | 3 | 3 | ||
3612 | 4 | math:quotient(-10,3) | 4 | math:quotient(-10,3) |
3613 | 5 | 5 | ||
3614 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.spec' | |||
3615 | --- test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.spec 2013-02-07 17:24:36 +0000 | |||
3616 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.spec 2013-07-17 15:56:30 +0000 | |||
3617 | @@ -1,1 +1,1 @@ | |||
3619 | 1 | Error: http://www.zorba-xquery.com/modules/math:Div0 | 1 | Error: http://zorba.io/modules/math:DIVIDE_BY_0 |
3620 | 2 | 2 | ||
3621 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq' | |||
3622 | --- test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq 2013-02-07 17:24:36 +0000 | |||
3623 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_quotient4.xq 2013-07-17 15:56:30 +0000 | |||
3624 | @@ -1,5 +1,5 @@ | |||
3625 | 1 | import module namespace | 1 | import module namespace |
3627 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3628 | 3 | 3 | ||
3629 | 4 | math:quotient(1,0) | 4 | math:quotient(1,0) |
3630 | 5 | 5 | ||
3631 | 6 | 6 | ||
3632 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rank1.xq' | |||
3633 | --- test/rbkt/Queries/zorba/math/from_excel/excel_rank1.xq 2013-02-07 17:24:36 +0000 | |||
3634 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_rank1.xq 2013-07-17 15:56:30 +0000 | |||
3635 | @@ -1,4 +1,4 @@ | |||
3636 | 1 | import module namespace | 1 | import module namespace |
3638 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3639 | 3 | 3 | ||
3640 | 4 | math:rank(3.5, (7, 3.5, 3.5, 1, 2), fn:true() ) | 4 | math:rank(3.5, (7, 3.5, 3.5, 1, 2), fn:true() ) |
3641 | 5 | 5 | ||
3642 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rank2.xq' | |||
3643 | --- test/rbkt/Queries/zorba/math/from_excel/excel_rank2.xq 2013-02-07 17:24:36 +0000 | |||
3644 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_rank2.xq 2013-07-17 15:56:30 +0000 | |||
3645 | @@ -1,4 +1,4 @@ | |||
3646 | 1 | import module namespace | 1 | import module namespace |
3648 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3649 | 3 | 3 | ||
3650 | 4 | math:rank(7, (7, 3.5, 3.5, 1, 2), fn:true() ) | 4 | math:rank(7, (7, 3.5, 3.5, 1, 2), fn:true() ) |
3651 | 5 | 5 | ||
3652 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rank3.xq' | |||
3653 | --- test/rbkt/Queries/zorba/math/from_excel/excel_rank3.xq 2013-02-07 17:24:36 +0000 | |||
3654 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_rank3.xq 2013-07-17 15:56:30 +0000 | |||
3655 | @@ -1,4 +1,4 @@ | |||
3656 | 1 | import module namespace | 1 | import module namespace |
3658 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3659 | 3 | 3 | ||
3660 | 4 | math:rank(3.5, (7, 3.5, 3.5, 1, 2) ) | 4 | math:rank(3.5, (7, 3.5, 3.5, 1, 2) ) |
3661 | 5 | 5 | ||
3662 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq' | |||
3663 | --- test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq 2013-02-07 17:24:36 +0000 | |||
3664 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_rank4.xq 2013-07-17 15:56:30 +0000 | |||
3665 | @@ -1,4 +1,4 @@ | |||
3666 | 1 | import module namespace | 1 | import module namespace |
3668 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3669 | 3 | 3 | ||
3670 | 4 | math:rank(3.5, (2, 3, 4), fn:true() ) | 4 | math:rank(3.5, (2, 3, 4), fn:true() ) |
3671 | 5 | 5 | ||
3672 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq' | |||
3673 | --- test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq 2013-02-07 17:24:36 +0000 | |||
3674 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_rank5.xq 2013-07-17 15:56:30 +0000 | |||
3675 | @@ -1,4 +1,4 @@ | |||
3676 | 1 | import module namespace | 1 | import module namespace |
3678 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3679 | 3 | 3 | ||
3680 | 4 | math:rank(3.5, (1, 2) ) | 4 | math:rank(3.5, (1, 2) ) |
3681 | 5 | 5 | ||
3682 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq' | |||
3683 | --- test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq 2013-02-07 17:24:36 +0000 | |||
3684 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_roman1.xq 2013-07-17 15:56:30 +0000 | |||
3685 | @@ -1,4 +1,4 @@ | |||
3686 | 1 | import module namespace | 1 | import module namespace |
3688 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3689 | 3 | 3 | ||
3690 | 4 | math:roman(499) | 4 | math:roman(499) |
3691 | 5 | 5 | ||
3692 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq' | |||
3693 | --- test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq 2013-02-07 17:24:36 +0000 | |||
3694 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_roman2.xq 2013-07-17 15:56:30 +0000 | |||
3695 | @@ -1,4 +1,4 @@ | |||
3696 | 1 | import module namespace | 1 | import module namespace |
3698 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3699 | 3 | 3 | ||
3700 | 4 | math:roman(2009) | 4 | math:roman(2009) |
3701 | 5 | 5 | ||
3702 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq' | |||
3703 | --- test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq 2013-02-07 17:24:36 +0000 | |||
3704 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_roman3.xq 2013-07-17 15:56:30 +0000 | |||
3705 | @@ -1,4 +1,4 @@ | |||
3706 | 1 | import module namespace | 1 | import module namespace |
3708 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3709 | 3 | 3 | ||
3710 | 4 | math:roman(1555) | 4 | math:roman(1555) |
3711 | 5 | 5 | ||
3712 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_round1.xq' | |||
3713 | --- test/rbkt/Queries/zorba/math/from_excel/excel_round1.xq 2013-02-07 17:24:36 +0000 | |||
3714 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_round1.xq 2013-07-17 15:56:30 +0000 | |||
3715 | @@ -1,4 +1,4 @@ | |||
3716 | 1 | import module namespace | 1 | import module namespace |
3718 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3719 | 3 | 3 | ||
3720 | 4 | math:round(2.15, 1) | 4 | math:round(2.15, 1) |
3721 | 5 | 5 | ||
3722 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_round2.xq' | |||
3723 | --- test/rbkt/Queries/zorba/math/from_excel/excel_round2.xq 2013-02-07 17:24:36 +0000 | |||
3724 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_round2.xq 2013-07-17 15:56:30 +0000 | |||
3725 | @@ -1,4 +1,4 @@ | |||
3726 | 1 | import module namespace | 1 | import module namespace |
3728 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3729 | 3 | 3 | ||
3730 | 4 | math:round(2.149, 1) | 4 | math:round(2.149, 1) |
3731 | 5 | 5 | ||
3732 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_round3.xq' | |||
3733 | --- test/rbkt/Queries/zorba/math/from_excel/excel_round3.xq 2013-02-07 17:24:36 +0000 | |||
3734 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_round3.xq 2013-07-17 15:56:30 +0000 | |||
3735 | @@ -1,4 +1,4 @@ | |||
3736 | 1 | import module namespace | 1 | import module namespace |
3738 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3739 | 3 | 3 | ||
3740 | 4 | math:round(-1.475, 2) | 4 | math:round(-1.475, 2) |
3741 | 5 | 5 | ||
3742 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq' | |||
3743 | --- test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq 2013-02-07 17:24:36 +0000 | |||
3744 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_round4.xq 2013-07-17 15:56:30 +0000 | |||
3745 | @@ -1,4 +1,4 @@ | |||
3746 | 1 | import module namespace | 1 | import module namespace |
3748 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3749 | 3 | 3 | ||
3750 | 4 | math:round(21.5, -1) | 4 | math:round(21.5, -1) |
3751 | 5 | 5 | ||
3752 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rounddown1.xq' | |||
3753 | --- test/rbkt/Queries/zorba/math/from_excel/excel_rounddown1.xq 2013-02-07 17:24:36 +0000 | |||
3754 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_rounddown1.xq 2013-07-17 15:56:30 +0000 | |||
3755 | @@ -1,4 +1,4 @@ | |||
3756 | 1 | import module namespace | 1 | import module namespace |
3758 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3759 | 3 | 3 | ||
3760 | 4 | math:rounddown(3.2, 0) | 4 | math:rounddown(3.2, 0) |
3761 | 5 | 5 | ||
3762 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rounddown2.xq' | |||
3763 | --- test/rbkt/Queries/zorba/math/from_excel/excel_rounddown2.xq 2013-02-07 17:24:36 +0000 | |||
3764 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_rounddown2.xq 2013-07-17 15:56:30 +0000 | |||
3765 | @@ -1,4 +1,4 @@ | |||
3766 | 1 | import module namespace | 1 | import module namespace |
3768 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3769 | 3 | 3 | ||
3770 | 4 | math:rounddown(76.9,0) | 4 | math:rounddown(76.9,0) |
3771 | 5 | 5 | ||
3772 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rounddown3.xq' | |||
3773 | --- test/rbkt/Queries/zorba/math/from_excel/excel_rounddown3.xq 2013-02-07 17:24:36 +0000 | |||
3774 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_rounddown3.xq 2013-07-17 15:56:30 +0000 | |||
3775 | @@ -1,4 +1,4 @@ | |||
3776 | 1 | import module namespace | 1 | import module namespace |
3778 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3779 | 3 | 3 | ||
3780 | 4 | math:rounddown(3.14159, 3) | 4 | math:rounddown(3.14159, 3) |
3781 | 5 | 5 | ||
3782 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rounddown4.xq' | |||
3783 | --- test/rbkt/Queries/zorba/math/from_excel/excel_rounddown4.xq 2013-02-07 17:24:36 +0000 | |||
3784 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_rounddown4.xq 2013-07-17 15:56:30 +0000 | |||
3785 | @@ -1,4 +1,4 @@ | |||
3786 | 1 | import module namespace | 1 | import module namespace |
3788 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3789 | 3 | 3 | ||
3790 | 4 | math:rounddown(-3.14159, 1) | 4 | math:rounddown(-3.14159, 1) |
3791 | 5 | 5 | ||
3792 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq' | |||
3793 | --- test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq 2013-02-07 17:24:36 +0000 | |||
3794 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_rounddown5.xq 2013-07-17 15:56:30 +0000 | |||
3795 | @@ -1,4 +1,4 @@ | |||
3796 | 1 | import module namespace | 1 | import module namespace |
3798 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3799 | 3 | 3 | ||
3800 | 4 | math:rounddown(31415.92654, -2) | 4 | math:rounddown(31415.92654, -2) |
3801 | 5 | 5 | ||
3802 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roundup1.xq' | |||
3803 | --- test/rbkt/Queries/zorba/math/from_excel/excel_roundup1.xq 2013-02-07 17:24:36 +0000 | |||
3804 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_roundup1.xq 2013-07-17 15:56:30 +0000 | |||
3805 | @@ -1,4 +1,4 @@ | |||
3806 | 1 | import module namespace | 1 | import module namespace |
3808 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3809 | 3 | 3 | ||
3810 | 4 | math:roundup(3.2, 0) | 4 | math:roundup(3.2, 0) |
3811 | 5 | 5 | ||
3812 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roundup2.xq' | |||
3813 | --- test/rbkt/Queries/zorba/math/from_excel/excel_roundup2.xq 2013-02-07 17:24:36 +0000 | |||
3814 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_roundup2.xq 2013-07-17 15:56:30 +0000 | |||
3815 | @@ -1,4 +1,4 @@ | |||
3816 | 1 | import module namespace | 1 | import module namespace |
3818 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3819 | 3 | 3 | ||
3820 | 4 | math:roundup(76.9,0) | 4 | math:roundup(76.9,0) |
3821 | 5 | 5 | ||
3822 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roundup3.xq' | |||
3823 | --- test/rbkt/Queries/zorba/math/from_excel/excel_roundup3.xq 2013-02-07 17:24:36 +0000 | |||
3824 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_roundup3.xq 2013-07-17 15:56:30 +0000 | |||
3825 | @@ -1,4 +1,4 @@ | |||
3826 | 1 | import module namespace | 1 | import module namespace |
3828 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3829 | 3 | 3 | ||
3830 | 4 | math:roundup(3.14159, 3) | 4 | math:roundup(3.14159, 3) |
3831 | 5 | 5 | ||
3832 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roundup4.xq' | |||
3833 | --- test/rbkt/Queries/zorba/math/from_excel/excel_roundup4.xq 2013-02-07 17:24:36 +0000 | |||
3834 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_roundup4.xq 2013-07-17 15:56:30 +0000 | |||
3835 | @@ -1,4 +1,4 @@ | |||
3836 | 1 | import module namespace | 1 | import module namespace |
3838 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3839 | 3 | 3 | ||
3840 | 4 | math:roundup(-3.14159, 1) | 4 | math:roundup(-3.14159, 1) |
3841 | 5 | 5 | ||
3842 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq' | |||
3843 | --- test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq 2013-02-07 17:24:36 +0000 | |||
3844 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_roundup5.xq 2013-07-17 15:56:30 +0000 | |||
3845 | @@ -1,4 +1,4 @@ | |||
3846 | 1 | import module namespace | 1 | import module namespace |
3848 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3849 | 3 | 3 | ||
3850 | 4 | math:roundup(31415.92654, -2) | 4 | math:roundup(31415.92654, -2) |
3851 | 5 | 5 | ||
3852 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_sign1.xq' | |||
3853 | --- test/rbkt/Queries/zorba/math/from_excel/excel_sign1.xq 2013-02-07 17:24:36 +0000 | |||
3854 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_sign1.xq 2013-07-17 15:56:30 +0000 | |||
3855 | @@ -1,4 +1,4 @@ | |||
3856 | 1 | import module namespace | 1 | import module namespace |
3858 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3859 | 3 | 3 | ||
3860 | 4 | math:sign(100) | 4 | math:sign(100) |
3861 | 5 | 5 | ||
3862 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq' | |||
3863 | --- test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq 2013-02-07 17:24:36 +0000 | |||
3864 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_sign2.xq 2013-07-17 15:56:30 +0000 | |||
3865 | @@ -1,4 +1,4 @@ | |||
3866 | 1 | import module namespace | 1 | import module namespace |
3868 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3869 | 3 | 3 | ||
3870 | 4 | math:sign(0) | 4 | math:sign(0) |
3871 | 5 | 5 | ||
3872 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq' | |||
3873 | --- test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq 2013-02-07 17:24:36 +0000 | |||
3874 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_sign3.xq 2013-07-17 15:56:30 +0000 | |||
3875 | @@ -1,4 +1,4 @@ | |||
3876 | 1 | import module namespace | 1 | import module namespace |
3878 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3879 | 3 | 3 | ||
3880 | 4 | math:sign(-1E100) | 4 | math:sign(-1E100) |
3881 | 5 | 5 | ||
3882 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq' | |||
3883 | --- test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq 2013-02-07 17:24:36 +0000 | |||
3884 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_slope1.xq 2013-07-17 15:56:30 +0000 | |||
3885 | @@ -1,4 +1,4 @@ | |||
3886 | 1 | import module namespace | 1 | import module namespace |
3888 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3889 | 3 | 3 | ||
3890 | 4 | math:slope((2, 3, 9, 1, 8, 7, 5), (6, 5, 11, 7, 5, 4, 4)) | 4 | math:slope((2, 3, 9, 1, 8, 7, 5), (6, 5, 11, 7, 5, 4, 4)) |
3891 | 5 | 5 | ||
3892 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq' | |||
3893 | --- test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq 2013-02-07 17:24:36 +0000 | |||
3894 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_small1.xq 2013-07-17 15:56:30 +0000 | |||
3895 | @@ -1,4 +1,4 @@ | |||
3896 | 1 | import module namespace | 1 | import module namespace |
3898 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3899 | 3 | 3 | ||
3900 | 4 | math:small((3, 4, 5, 2, 3, 4, 6, 4, 7), 4) | 4 | math:small((3, 4, 5, 2, 3, 4, 6, 4, 7), 4) |
3901 | 5 | 5 | ||
3902 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq' | |||
3903 | --- test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq 2013-02-07 17:24:36 +0000 | |||
3904 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_small2.xq 2013-07-17 15:56:30 +0000 | |||
3905 | @@ -1,4 +1,4 @@ | |||
3906 | 1 | import module namespace | 1 | import module namespace |
3908 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3909 | 3 | 3 | ||
3910 | 4 | math:small((1, 4, 8, 3, 7, 12, 54, 8, 23), 2) | 4 | math:small((1, 4, 8, 3, 7, 12, 54, 8, 23), 2) |
3911 | 5 | 5 | ||
3912 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq' | |||
3913 | --- test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq 2013-02-07 17:24:36 +0000 | |||
3914 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_standardize1.xq 2013-07-17 15:56:30 +0000 | |||
3915 | @@ -1,4 +1,4 @@ | |||
3916 | 1 | import module namespace | 1 | import module namespace |
3918 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3919 | 3 | 3 | ||
3920 | 4 | math:standardize(42, 40, 1.5) | 4 | math:standardize(42, 40, 1.5) |
3921 | 5 | 5 | ||
3922 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq' | |||
3923 | --- test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq 2013-02-07 17:24:36 +0000 | |||
3924 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_stdev1.xq 2013-07-17 15:56:30 +0000 | |||
3925 | @@ -1,4 +1,4 @@ | |||
3926 | 1 | import module namespace | 1 | import module namespace |
3928 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3929 | 3 | 3 | ||
3930 | 4 | math:stdev((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:stdev((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
3931 | 5 | 5 | ||
3932 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq' | |||
3933 | --- test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq 2013-02-07 17:24:36 +0000 | |||
3934 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_stdeva1.xq 2013-07-17 15:56:30 +0000 | |||
3935 | @@ -1,4 +1,4 @@ | |||
3936 | 1 | import module namespace | 1 | import module namespace |
3938 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3939 | 3 | 3 | ||
3940 | 4 | math:stdeva((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:stdeva((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
3941 | 5 | 5 | ||
3942 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq' | |||
3943 | --- test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq 2013-02-07 17:24:36 +0000 | |||
3944 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_stdevp1.xq 2013-07-17 15:56:30 +0000 | |||
3945 | @@ -1,4 +1,4 @@ | |||
3946 | 1 | import module namespace | 1 | import module namespace |
3948 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3949 | 3 | 3 | ||
3950 | 4 | math:stdevp((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:stdevp((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
3951 | 5 | 5 | ||
3952 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq' | |||
3953 | --- test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq 2013-02-07 17:24:36 +0000 | |||
3954 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_stdevpa1.xq 2013-07-17 15:56:30 +0000 | |||
3955 | @@ -1,4 +1,4 @@ | |||
3956 | 1 | import module namespace | 1 | import module namespace |
3958 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3959 | 3 | 3 | ||
3960 | 4 | math:stdevpa((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:stdevpa((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
3961 | 5 | 5 | ||
3962 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq' | |||
3963 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq 2013-02-07 17:24:36 +0000 | |||
3964 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal1.xq 2013-07-17 15:56:30 +0000 | |||
3965 | @@ -1,4 +1,4 @@ | |||
3966 | 1 | import module namespace | 1 | import module namespace |
3968 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3969 | 3 | 3 | ||
3970 | 4 | math:subtotal(1, (2, 3, 4)) | 4 | math:subtotal(1, (2, 3, 4)) |
3971 | 5 | 5 | ||
3972 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq' | |||
3973 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq 2013-02-07 17:24:36 +0000 | |||
3974 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal10.xq 2013-07-17 15:56:30 +0000 | |||
3975 | @@ -1,4 +1,4 @@ | |||
3976 | 1 | import module namespace | 1 | import module namespace |
3978 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3979 | 3 | 3 | ||
3980 | 4 | math:subtotal(10, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:subtotal(10, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
3981 | 5 | 5 | ||
3982 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq' | |||
3983 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq 2013-02-07 17:24:36 +0000 | |||
3984 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal11.xq 2013-07-17 15:56:30 +0000 | |||
3985 | @@ -1,4 +1,4 @@ | |||
3986 | 1 | import module namespace | 1 | import module namespace |
3988 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3989 | 3 | 3 | ||
3990 | 4 | math:subtotal(11, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:subtotal(11, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
3991 | 5 | 5 | ||
3992 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq' | |||
3993 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq 2013-02-07 17:24:36 +0000 | |||
3994 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal2.xq 2013-07-17 15:56:30 +0000 | |||
3995 | @@ -1,4 +1,4 @@ | |||
3996 | 1 | import module namespace | 1 | import module namespace |
3998 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
3999 | 3 | 3 | ||
4000 | 4 | math:subtotal(2, (2, 3, 4)) | 4 | math:subtotal(2, (2, 3, 4)) |
4001 | 5 | 5 | ||
4002 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq' | |||
4003 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq 2013-02-07 17:24:36 +0000 | |||
4004 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal3.xq 2013-07-17 15:56:30 +0000 | |||
4005 | @@ -1,5 +1,5 @@ | |||
4006 | 1 | import module namespace | 1 | import module namespace |
4008 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4009 | 3 | 3 | ||
4010 | 4 | math:subtotal(3, (2, 3, 4, "", "x")) | 4 | math:subtotal(3, (2, 3, 4, "", "x")) |
4011 | 5 | 5 | ||
4012 | 6 | 6 | ||
4013 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal4.xq' | |||
4014 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal4.xq 2013-02-07 17:24:36 +0000 | |||
4015 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal4.xq 2013-07-17 15:56:30 +0000 | |||
4016 | @@ -1,4 +1,4 @@ | |||
4017 | 1 | import module namespace | 1 | import module namespace |
4019 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4020 | 3 | 3 | ||
4021 | 4 | math:subtotal(4, (2, 3, 4)) | 4 | math:subtotal(4, (2, 3, 4)) |
4022 | 5 | 5 | ||
4023 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal5.xq' | |||
4024 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal5.xq 2013-02-07 17:24:36 +0000 | |||
4025 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal5.xq 2013-07-17 15:56:30 +0000 | |||
4026 | @@ -1,4 +1,4 @@ | |||
4027 | 1 | import module namespace | 1 | import module namespace |
4029 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4030 | 3 | 3 | ||
4031 | 4 | math:subtotal(5, (2, 3, 4)) | 4 | math:subtotal(5, (2, 3, 4)) |
4032 | 5 | 5 | ||
4033 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal6.xq' | |||
4034 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal6.xq 2013-02-07 17:24:36 +0000 | |||
4035 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal6.xq 2013-07-17 15:56:30 +0000 | |||
4036 | @@ -1,4 +1,4 @@ | |||
4037 | 1 | import module namespace | 1 | import module namespace |
4039 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4040 | 3 | 3 | ||
4041 | 4 | math:subtotal(6, (2, 3, 4)) | 4 | math:subtotal(6, (2, 3, 4)) |
4042 | 5 | 5 | ||
4043 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal7.xq' | |||
4044 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal7.xq 2013-02-07 17:24:36 +0000 | |||
4045 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal7.xq 2013-07-17 15:56:30 +0000 | |||
4046 | @@ -1,4 +1,4 @@ | |||
4047 | 1 | import module namespace | 1 | import module namespace |
4049 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4050 | 3 | 3 | ||
4051 | 4 | math:subtotal(7, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:subtotal(7, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
4052 | 5 | 5 | ||
4053 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal8.xq' | |||
4054 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal8.xq 2013-02-07 17:24:36 +0000 | |||
4055 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal8.xq 2013-07-17 15:56:30 +0000 | |||
4056 | @@ -1,4 +1,4 @@ | |||
4057 | 1 | import module namespace | 1 | import module namespace |
4059 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4060 | 3 | 3 | ||
4061 | 4 | math:subtotal(8, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:subtotal(8, (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
4062 | 5 | 5 | ||
4063 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_subtotal9.xq' | |||
4064 | --- test/rbkt/Queries/zorba/math/from_excel/excel_subtotal9.xq 2013-02-07 17:24:36 +0000 | |||
4065 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_subtotal9.xq 2013-07-17 15:56:30 +0000 | |||
4066 | @@ -1,4 +1,4 @@ | |||
4067 | 1 | import module namespace | 1 | import module namespace |
4069 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4070 | 3 | 3 | ||
4071 | 4 | math:subtotal(9, (2, 3, 4)) | 4 | math:subtotal(9, (2, 3, 4)) |
4072 | 5 | 5 | ||
4073 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq' | |||
4074 | --- test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq 2013-02-07 17:24:36 +0000 | |||
4075 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_sumproduct2.xq 2013-07-17 15:56:30 +0000 | |||
4076 | @@ -1,5 +1,5 @@ | |||
4077 | 1 | import module namespace | 1 | import module namespace |
4079 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4080 | 3 | 3 | ||
4081 | 4 | math:sumproduct((1,2,3,4,5), | 4 | math:sumproduct((1,2,3,4,5), |
4082 | 5 | (1,2,3,4,5)) | 5 | (1,2,3,4,5)) |
4083 | 6 | 6 | ||
4084 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq' | |||
4085 | --- test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq 2013-02-07 17:24:36 +0000 | |||
4086 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_sumsq1.xq 2013-07-17 15:56:30 +0000 | |||
4087 | @@ -1,4 +1,4 @@ | |||
4088 | 1 | import module namespace | 1 | import module namespace |
4090 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4091 | 3 | 3 | ||
4092 | 4 | math:sumsq((1,2,3,4,5)) | 4 | math:sumsq((1,2,3,4,5)) |
4093 | 5 | 5 | ||
4094 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq' | |||
4095 | --- test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq 2013-02-07 17:24:36 +0000 | |||
4096 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_trunc1.xq 2013-07-17 15:56:30 +0000 | |||
4097 | @@ -1,4 +1,4 @@ | |||
4098 | 1 | import module namespace | 1 | import module namespace |
4100 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4101 | 3 | 3 | ||
4102 | 4 | math:trunc(8.9) | 4 | math:trunc(8.9) |
4103 | 5 | 5 | ||
4104 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq' | |||
4105 | --- test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq 2013-02-07 17:24:36 +0000 | |||
4106 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_trunc2.xq 2013-07-17 15:56:30 +0000 | |||
4107 | @@ -1,4 +1,4 @@ | |||
4108 | 1 | import module namespace | 1 | import module namespace |
4110 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4111 | 3 | 3 | ||
4112 | 4 | math:trunc(-8.9) | 4 | math:trunc(-8.9) |
4113 | 5 | 5 | ||
4114 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq' | |||
4115 | --- test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq 2013-02-07 17:24:36 +0000 | |||
4116 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_trunc3.xq 2013-07-17 15:56:30 +0000 | |||
4117 | @@ -1,5 +1,5 @@ | |||
4118 | 1 | declare namespace math="http://www.w3.org/2005/xpath-functions/math"; | 1 | declare namespace math="http://www.w3.org/2005/xpath-functions/math"; |
4119 | 2 | import module namespace | 2 | import module namespace |
4121 | 3 | zorba-math="http://www.zorba-xquery.com/modules/math"; | 3 | zorba-math="http://zorba.io/modules/math"; |
4122 | 4 | 4 | ||
4123 | 5 | zorba-math:trunc(math:pi(), 2) | 5 | zorba-math:trunc(math:pi(), 2) |
4124 | 6 | 6 | ||
4125 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq' | |||
4126 | --- test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq 2013-02-07 17:24:36 +0000 | |||
4127 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_var1.xq 2013-07-17 15:56:30 +0000 | |||
4128 | @@ -1,4 +1,4 @@ | |||
4129 | 1 | import module namespace | 1 | import module namespace |
4131 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4132 | 3 | 3 | ||
4133 | 4 | math:var((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:var((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
4134 | 5 | 5 | ||
4135 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq' | |||
4136 | --- test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq 2013-02-07 17:24:36 +0000 | |||
4137 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_vara1.xq 2013-07-17 15:56:30 +0000 | |||
4138 | @@ -1,4 +1,4 @@ | |||
4139 | 1 | import module namespace | 1 | import module namespace |
4141 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4142 | 3 | 3 | ||
4143 | 4 | math:vara((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:vara((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
4144 | 5 | 5 | ||
4145 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq' | |||
4146 | --- test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq 2013-02-07 17:24:36 +0000 | |||
4147 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_varp1.xq 2013-07-17 15:56:30 +0000 | |||
4148 | @@ -1,4 +1,4 @@ | |||
4149 | 1 | import module namespace | 1 | import module namespace |
4151 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4152 | 3 | 3 | ||
4153 | 4 | math:varp((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:varp((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
4154 | 5 | 5 | ||
4155 | === modified file 'test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq' | |||
4156 | --- test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq 2013-02-07 17:24:36 +0000 | |||
4157 | +++ test/rbkt/Queries/zorba/math/from_excel/excel_varpa1.xq 2013-07-17 15:56:30 +0000 | |||
4158 | @@ -1,4 +1,4 @@ | |||
4159 | 1 | import module namespace | 1 | import module namespace |
4161 | 2 | math="http://www.zorba-xquery.com/modules/math"; | 2 | math="http://zorba.io/modules/math"; |
4162 | 3 | 3 | ||
4163 | 4 | math:varpa((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) | 4 | math:varpa((1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299)) |
4164 | 5 | 5 | ||
4165 | === modified file 'test/rbkt/Queries/zorba/math/is_inf1.xq' | |||
4166 | --- test/rbkt/Queries/zorba/math/is_inf1.xq 2013-02-07 17:24:36 +0000 | |||
4167 | +++ test/rbkt/Queries/zorba/math/is_inf1.xq 2013-07-17 15:56:30 +0000 | |||
4168 | @@ -1,4 +1,4 @@ | |||
4169 | 1 | declare namespace math="http://www.w3.org/2005/xpath-functions/math"; | 1 | declare namespace math="http://www.w3.org/2005/xpath-functions/math"; |
4171 | 2 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 2 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
4172 | 3 | 3 | ||
4173 | 4 | fn-zorba-math:is_inf(math:pow(0, -1)) | 4 | fn-zorba-math:is_inf(math:pow(0, -1)) |
4174 | 5 | 5 | ||
4175 | === modified file 'test/rbkt/Queries/zorba/math/is_nan1.xq' | |||
4176 | --- test/rbkt/Queries/zorba/math/is_nan1.xq 2013-02-07 17:24:36 +0000 | |||
4177 | +++ test/rbkt/Queries/zorba/math/is_nan1.xq 2013-07-17 15:56:30 +0000 | |||
4178 | @@ -1,3 +1,3 @@ | |||
4180 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
4181 | 2 | 2 | ||
4182 | 3 | fn-zorba-math:is_nan(xs:double("NaN")) | 3 | fn-zorba-math:is_nan(xs:double("NaN")) |
4183 | 4 | 4 | ||
4184 | === modified file 'test/rbkt/Queries/zorba/math/ldexp1.xq' | |||
4185 | --- test/rbkt/Queries/zorba/math/ldexp1.xq 2013-02-07 17:24:36 +0000 | |||
4186 | +++ test/rbkt/Queries/zorba/math/ldexp1.xq 2013-07-17 15:56:30 +0000 | |||
4187 | @@ -1,3 +1,3 @@ | |||
4189 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
4190 | 2 | 2 | ||
4191 | 3 | fn-zorba-math:ldexp(4, 3) | 3 | fn-zorba-math:ldexp(4, 3) |
4192 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
4193 | 5 | 5 | ||
4194 | === modified file 'test/rbkt/Queries/zorba/math/modf1.xq' | |||
4195 | --- test/rbkt/Queries/zorba/math/modf1.xq 2013-02-07 17:24:36 +0000 | |||
4196 | +++ test/rbkt/Queries/zorba/math/modf1.xq 2013-07-17 15:56:30 +0000 | |||
4197 | @@ -1,3 +1,3 @@ | |||
4199 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
4200 | 2 | 2 | ||
4201 | 3 | fn-zorba-math:modf(-14.876543) | 3 | fn-zorba-math:modf(-14.876543) |
4202 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
4203 | 5 | 5 | ||
4204 | === modified file 'test/rbkt/Queries/zorba/math/sinh1.xq' | |||
4205 | --- test/rbkt/Queries/zorba/math/sinh1.xq 2013-02-07 17:24:36 +0000 | |||
4206 | +++ test/rbkt/Queries/zorba/math/sinh1.xq 2013-07-17 15:56:30 +0000 | |||
4207 | @@ -1,4 +1,4 @@ | |||
4208 | 1 | declare namespace math="http://www.w3.org/2005/xpath-functions/math"; | 1 | declare namespace math="http://www.w3.org/2005/xpath-functions/math"; |
4210 | 2 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 2 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
4211 | 3 | 3 | ||
4212 | 4 | fn-zorba-math:sinh(math:pi() div 2) | 4 | fn-zorba-math:sinh(math:pi() div 2) |
4213 | 5 | \ No newline at end of file | 5 | \ No newline at end of file |
4214 | 6 | 6 | ||
4215 | === modified file 'test/rbkt/Queries/zorba/math/tanh1.xq' | |||
4216 | --- test/rbkt/Queries/zorba/math/tanh1.xq 2013-02-07 17:24:36 +0000 | |||
4217 | +++ test/rbkt/Queries/zorba/math/tanh1.xq 2013-07-17 15:56:30 +0000 | |||
4218 | @@ -1,3 +1,3 @@ | |||
4220 | 1 | import module namespace fn-zorba-math = "http://www.zorba-xquery.com/modules/math"; | 1 | import module namespace fn-zorba-math = "http://zorba.io/modules/math"; |
4221 | 2 | 2 | ||
4222 | 3 | fn-zorba-math:tanh(1) | 3 | fn-zorba-math:tanh(1) |
4223 | 4 | \ No newline at end of file | 4 | \ No newline at end of file |
4224 | 5 | 5 | ||
4225 | === modified file 'test/rbkt/Queries/zorba/random/random1.xq' | |||
4226 | --- test/rbkt/Queries/zorba/random/random1.xq 2013-02-07 17:24:36 +0000 | |||
4227 | +++ test/rbkt/Queries/zorba/random/random1.xq 2013-07-17 15:56:30 +0000 | |||
4228 | @@ -1,3 +1,3 @@ | |||
4230 | 1 | import module namespace r = "http://www.zorba-xquery.com/modules/random"; | 1 | import module namespace r = "http://zorba.io/modules/random"; |
4231 | 2 | 2 | ||
4232 | 3 | count((for $i in 1 to 10 return r:random(10), r:random())) eq 101 | 3 | count((for $i in 1 to 10 return r:random(10), r:random())) eq 101 |
4233 | 4 | 4 | ||
4234 | === modified file 'test/rbkt/Queries/zorba/random/seeded-random-between1.xq' | |||
4235 | --- test/rbkt/Queries/zorba/random/seeded-random-between1.xq 2013-02-07 17:24:36 +0000 | |||
4236 | +++ test/rbkt/Queries/zorba/random/seeded-random-between1.xq 2013-07-17 15:56:30 +0000 | |||
4237 | @@ -1,4 +1,4 @@ | |||
4239 | 1 | import module namespace r = "http://www.zorba-xquery.com/modules/random"; | 1 | import module namespace r = "http://zorba.io/modules/random"; |
4240 | 2 | 2 | ||
4241 | 3 | declare namespace err = "http://www.w3.org/2005/xqt-errors"; | 3 | declare namespace err = "http://www.w3.org/2005/xqt-errors"; |
4242 | 4 | 4 | ||
4243 | @@ -10,7 +10,7 @@ | |||
4244 | 10 | try | 10 | try |
4245 | 11 | { | 11 | { |
4246 | 12 | r:seeded-random-between(1, 4, 1, 100) | 12 | r:seeded-random-between(1, 4, 1, 100) |
4248 | 13 | } catch r:invalid-arg | 13 | } catch r:INVALID_ARGUMENT |
4249 | 14 | { | 14 | { |
4250 | 15 | $err:description, $err:value | 15 | $err:description, $err:value |
4251 | 16 | } | 16 | } |
4252 | 17 | 17 | ||
4253 | === modified file 'test/rbkt/Queries/zorba/random/seeded-random1.xq' | |||
4254 | --- test/rbkt/Queries/zorba/random/seeded-random1.xq 2013-06-25 03:55:20 +0000 | |||
4255 | +++ test/rbkt/Queries/zorba/random/seeded-random1.xq 2013-07-17 15:56:30 +0000 | |||
4256 | @@ -1,4 +1,4 @@ | |||
4258 | 1 | import module namespace r = "http://www.zorba-xquery.com/modules/random"; | 1 | import module namespace r = "http://zorba.io/modules/random"; |
4259 | 2 | 2 | ||
4260 | 3 | declare namespace zerr = "http://zorba.io/modules/zorba-errors"; | 3 | declare namespace zerr = "http://zorba.io/modules/zorba-errors"; |
4261 | 4 | declare namespace err = "http://www.w3.org/2005/xqt-errors"; | 4 | declare namespace err = "http://www.w3.org/2005/xqt-errors"; |
4262 | 5 | 5 | ||
4263 | === modified file 'test/rbkt/Queries/zorba/random/uuid1.xq' | |||
4264 | --- test/rbkt/Queries/zorba/random/uuid1.xq 2013-02-07 17:24:36 +0000 | |||
4265 | +++ test/rbkt/Queries/zorba/random/uuid1.xq 2013-07-17 15:56:30 +0000 | |||
4266 | @@ -1,4 +1,4 @@ | |||
4268 | 1 | import module namespace r = "http://www.zorba-xquery.com/modules/random"; | 1 | import module namespace r = "http://zorba.io/modules/random"; |
4269 | 2 | 2 | ||
4270 | 3 | (: all uuids are distinct? :) | 3 | (: all uuids are distinct? :) |
4271 | 4 | let $seq := for $i in 1 to 10 return r:uuid() | 4 | let $seq := for $i in 1 to 10 return r:uuid() |
4272 | 5 | 5 | ||
4273 | === modified file 'test/rbkt/Queries/zorba/random/uuid2.xq' | |||
4274 | --- test/rbkt/Queries/zorba/random/uuid2.xq 2013-02-07 17:24:36 +0000 | |||
4275 | +++ test/rbkt/Queries/zorba/random/uuid2.xq 2013-07-17 15:56:30 +0000 | |||
4276 | @@ -1,4 +1,4 @@ | |||
4278 | 1 | import module namespace r = "http://www.zorba-xquery.com/modules/random"; | 1 | import module namespace r = "http://zorba.io/modules/random"; |
4279 | 2 | 2 | ||
4280 | 3 | (: all uuids are distinct? :) | 3 | (: all uuids are distinct? :) |
4281 | 4 | let $seq := for $i in 1 to 10 return r:uuid() | 4 | let $seq := for $i in 1 to 10 return r:uuid() |
4282 | 5 | 5 | ||
4283 | === modified file 'test/rbkt/Queries/zorba/reflection/reflection-invoke-10.xq' | |||
4284 | --- test/rbkt/Queries/zorba/reflection/reflection-invoke-10.xq 2013-02-07 17:24:36 +0000 | |||
4285 | +++ test/rbkt/Queries/zorba/reflection/reflection-invoke-10.xq 2013-07-17 15:56:30 +0000 | |||
4286 | @@ -1,6 +1,6 @@ | |||
4287 | 1 | import module namespace ref = "http://www.zorba-xquery.com/modules/reflection"; | 1 | import module namespace ref = "http://www.zorba-xquery.com/modules/reflection"; |
4289 | 2 | import module namespace rand = "http://www.zorba-xquery.com/modules/random"; | 2 | import module namespace rand = "http://zorba.io/modules/random"; |
4290 | 3 | 3 | ||
4292 | 4 | declare variable $name as xs:QName := fn:QName('http://www.zorba-xquery.com/modules/random', 'random'); | 4 | declare variable $name as xs:QName := fn:QName('http://zorba.io/modules/random', 'random'); |
4293 | 5 | 5 | ||
4294 | 6 | count( ref:invoke($name) ) > 0 | 6 | count( ref:invoke($name) ) > 0 |
4295 | 7 | 7 | ||
4296 | === modified file 'test/rbkt/Queries/zorba/scripting/constr4.xq' | |||
4297 | --- test/rbkt/Queries/zorba/scripting/constr4.xq 2013-02-07 17:24:36 +0000 | |||
4298 | +++ test/rbkt/Queries/zorba/scripting/constr4.xq 2013-07-17 15:56:30 +0000 | |||
4299 | @@ -1,4 +1,4 @@ | |||
4301 | 1 | import module namespace r = "http://www.zorba-xquery.com/modules/random"; | 1 | import module namespace r = "http://zorba.io/modules/random"; |
4302 | 2 | 2 | ||
4303 | 3 | (: test call to a nondeterministic function in an element constructor :) | 3 | (: test call to a nondeterministic function in an element constructor :) |
4304 | 4 | element book { | 4 | element book { |
4305 | 5 | 5 | ||
4306 | === modified file 'test/rbkt/Queries/zorba/string/AnalyzeString/http-client-doc.htm' | |||
4307 | --- test/rbkt/Queries/zorba/string/AnalyzeString/http-client-doc.htm 2013-07-17 07:20:31 +0000 | |||
4308 | +++ test/rbkt/Queries/zorba/string/AnalyzeString/http-client-doc.htm 2013-07-17 15:56:30 +0000 | |||
4309 | @@ -126,7 +126,7 @@ | |||
4310 | 126 | </sup> | 126 | </sup> |
4311 | 127 | </li> | 127 | </li> |
4312 | 128 | <li> | 128 | <li> |
4314 | 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> |
4315 | 130 | <sup> | 130 | <sup> |
4316 | 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> |
4317 | 132 | </sup> | 132 | </sup> |
4318 | @@ -135,7 +135,7 @@ | |||
4319 | 135 | </sup> | 135 | </sup> |
4320 | 136 | </li> | 136 | </li> |
4321 | 137 | <li> | 137 | <li> |
4323 | 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> |
4324 | 139 | <sup> | 139 | <sup> |
4325 | 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> |
4326 | 141 | </sup> | 141 | </sup> |
4327 | 142 | 142 | ||
4328 | === modified file 'test/rbkt/Queries/zorba/xqxq/external-module.xq' | |||
4329 | --- test/rbkt/Queries/zorba/xqxq/external-module.xq 2012-10-25 00:07:03 +0000 | |||
4330 | +++ test/rbkt/Queries/zorba/xqxq/external-module.xq 2013-07-17 15:56:30 +0000 | |||
4331 | @@ -1,7 +1,7 @@ | |||
4332 | 1 | import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; | 1 | import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
4333 | 2 | 2 | ||
4334 | 3 | variable $query-key := xqxq:prepare-main-module(' | 3 | variable $query-key := xqxq:prepare-main-module(' |
4336 | 4 | import module namespace r = "http://www.zorba-xquery.com/modules/random"; | 4 | import module namespace r = "http://zorba.io/modules/random"; |
4337 | 5 | 5 | ||
4338 | 6 | count((for $i in 1 to 10 return r:random(10), r:random())) eq 101 | 6 | count((for $i in 1 to 10 return r:random(10), r:random())) eq 101 |
4339 | 7 | '); | 7 | '); |
4340 | 8 | 8 | ||
4341 | === modified file 'test/unit/invoke.cpp' | |||
4342 | --- test/unit/invoke.cpp 2013-02-07 17:24:36 +0000 | |||
4343 | +++ test/unit/invoke.cpp 2013-07-17 15:56:30 +0000 | |||
4344 | @@ -164,12 +164,12 @@ | |||
4345 | 164 | 164 | ||
4346 | 165 | std::ostringstream lProlog; | 165 | std::ostringstream lProlog; |
4347 | 166 | lProlog | 166 | lProlog |
4349 | 167 | << "import module namespace r = 'http://www.zorba-xquery.com/modules/random';"; | 167 | << "import module namespace r = 'http://zorba.io/modules/random';"; |
4350 | 168 | lSctx->loadProlog(lProlog.str(), lHints); | 168 | lSctx->loadProlog(lProlog.str(), lHints); |
4351 | 169 | 169 | ||
4352 | 170 | ItemFactory* lFac = z->getItemFactory(); | 170 | ItemFactory* lFac = z->getItemFactory(); |
4353 | 171 | Item lQName = lFac->createQName( | 171 | Item lQName = lFac->createQName( |
4355 | 172 | "http://www.zorba-xquery.com/modules/random", | 172 | "http://zorba.io/modules/random", |
4356 | 173 | "random"); | 173 | "random"); |
4357 | 174 | 174 | ||
4358 | 175 | std::vector<ItemSequence_t> lArgs; | 175 | std::vector<ItemSequence_t> lArgs; |
Validation queue starting for the following merge proposals: /code.launchpad .net/~zorba- coders/ zorba/bug- 1189794- core/+merge/ 175224
https:/
Progress dashboard at http:// jenkins. lambda. nu/view/ ValidationQueue