Merge lp:~paul-lucas/zorba/bug-1090089 into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Paul J. Lucas
Approved revision: 11473
Merged at revision: 11451
Proposed branch: lp:~paul-lucas/zorba/bug-1090089
Merge into: lp:zorba
Diff against target: 896 lines (+218/-189)
34 files modified
src/compiler/parser/symbol_table.cpp (+0/-2)
src/diagnostics/diagnostic_en.xml (+2/-2)
src/diagnostics/pregenerated/dict_en.cpp (+1/-1)
src/functions/func_sequences_impl.cpp (+5/-5)
src/types/casting.cpp (+54/-7)
src/zorbatypes/decimal.cpp (+71/-104)
src/zorbatypes/floatimpl.cpp (+34/-43)
src/zorbatypes/integer.cpp (+16/-18)
src/zorbatypes/integer.h (+11/-5)
test/fots/CMakeLists.txt (+0/-2)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-04.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-05.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-06.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-07.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-08.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-09.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-11.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/numerics/xs_float-12.xml.res (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-01.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-02.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-03.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-04.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-05.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-06.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-07.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-08.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-09.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-10.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-11.xq (+1/-0)
test/rbkt/Queries/zorba/numerics/xs_float-12.xq (+1/-0)
To merge this branch: bzr merge lp:~paul-lucas/zorba/bug-1090089
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+163085@code.launchpad.net

Commit message

Rewrote decimal reduction code -- fixes rounding and FOTS distinct-values tests.

Description of the change

Rewrote decimal reduction code -- fixes rounding and FOTS distinct-values tests.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~paul-lucas/zorba/bug-1090089 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug-1090089-2013-05-09T05-23-51.58Z is finished. The
  final status was:

  28 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

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

The attempt to merge lp:~paul-lucas/zorba/bug-1090089 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug-1090089-2013-05-10T13-57-48.415Z is finished. The
  final status was:

  14 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

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

The attempt to merge lp:~paul-lucas/zorba/bug-1090089 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug-1090089-2013-05-11T15-21-54.602Z is finished. The
  final status was:

  5 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

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

The attempt to merge lp:~paul-lucas/zorba/bug-1090089 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug-1090089-2013-05-11T17-59-49.456Z is finished. The
  final status was:

  3 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

Note: even though FOTS test orderBy52a now fails, I think it worked before by "accident." The code is more consistent now, so orderBy52a now fails in the same way that the other FOTS orderBy tests fail.

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

The attempt to merge lp:~paul-lucas/zorba/bug-1090089 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug-1090089-2013-05-14T05-24-54.459Z is finished. The
  final status was:

  5 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

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

The attempt to merge lp:~paul-lucas/zorba/bug-1090089 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug-1090089-2013-05-14T17-44-51.575Z is finished. The
  final status was:

  4 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

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

Validation queue job bug-1090089-2013-05-14T18-46-51.049Z is finished. The final status was:

All tests succeeded!

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

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1, Needs Information < 1, Resubmit < 1. Got: 1 Approve.

Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~paul-lucas/zorba/bug-1090089 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug-1090089-2013-05-15T14-51-55.969Z is finished. The
  final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

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

Validation queue job bug-1090089-2013-05-15T15-42-59.231Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/compiler/parser/symbol_table.cpp'
--- src/compiler/parser/symbol_table.cpp 2013-05-09 18:03:47 +0000
+++ src/compiler/parser/symbol_table.cpp 2013-05-14 23:54:28 +0000
@@ -242,7 +242,6 @@
242 return new xs_decimal(text);242 return new xs_decimal(text);
243}243}
244244
245// Will return NULL if std::range_error is raised
246xs_double* symbol_table::doubleval(char const* text, size_t length)245xs_double* symbol_table::doubleval(char const* text, size_t length)
247{246{
248 try {247 try {
@@ -253,7 +252,6 @@
253 }252 }
254}253}
255254
256// Will return NULL if std::range_error is raised
257xs_integer* symbol_table::integerval(char const* text, size_t length)255xs_integer* symbol_table::integerval(char const* text, size_t length)
258{256{
259 try {257 try {
260258
=== modified file 'src/diagnostics/diagnostic_en.xml'
--- src/diagnostics/diagnostic_en.xml 2013-05-04 21:54:40 +0000
+++ src/diagnostics/diagnostic_en.xml 2013-05-14 23:54:28 +0000
@@ -1301,9 +1301,9 @@
13011301
1302 <diagnostic code="FOCA0003">1302 <diagnostic code="FOCA0003">
1303 <comment>1303 <comment>
1304 Input value too large for integer.1304 Input value too large for integer.
1305 </comment>1305 </comment>
1306 <value>"$1": value too large for integer</value>1306 <value>"$1": value${ of type 2} too large for $3?3:{integer}</value>
1307 </diagnostic>1307 </diagnostic>
13081308
1309 <diagnostic code="FOCA0005">1309 <diagnostic code="FOCA0005">
13101310
=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
--- src/diagnostics/pregenerated/dict_en.cpp 2013-05-04 21:54:40 +0000
+++ src/diagnostics/pregenerated/dict_en.cpp 2013-05-14 23:54:28 +0000
@@ -32,7 +32,7 @@
32 { "FOAR0002", "numeric operation overflow/underflow${: 1}" },32 { "FOAR0002", "numeric operation overflow/underflow${: 1}" },
33 { "FOCA0001", "\"$1\": value too large for decimal" },33 { "FOCA0001", "\"$1\": value too large for decimal" },
34 { "FOCA0002", "$1" },34 { "FOCA0002", "$1" },
35 { "FOCA0003", "\"$1\": value too large for integer" },35 { "FOCA0003", "\"$1\": value${ of type 2} too large for $3?3:{integer}" },
36 { "FOCA0005", "NaN supplied as float/double value" },36 { "FOCA0005", "NaN supplied as float/double value" },
37 { "FOCA0006", "\"$1\": string to be cast to decimal has too many digits of precision" },37 { "FOCA0006", "\"$1\": string to be cast to decimal has too many digits of precision" },
38 { "FOCH0001", "\"$1\": invalid code point" },38 { "FOCH0001", "\"$1\": invalid code point" },
3939
=== modified file 'src/functions/func_sequences_impl.cpp'
--- src/functions/func_sequences_impl.cpp 2013-03-24 20:40:03 +0000
+++ src/functions/func_sequences_impl.cpp 2013-05-14 23:54:28 +0000
@@ -79,7 +79,7 @@
79 pos = to_xs_long(ipos);79 pos = to_xs_long(ipos);
80 }80 }
81 }81 }
82 catch (std::range_error&)82 catch (std::exception const&)
83 {83 {
84 return false;84 return false;
85 }85 }
@@ -601,7 +601,7 @@
601 pos = to_xs_long(ipos);601 pos = to_xs_long(ipos);
602 len = to_xs_long(ilen);602 len = to_xs_long(ilen);
603 }603 }
604 catch (std::range_error&)604 catch (std::range_error const&)
605 {605 {
606 goto done;606 goto done;
607 }607 }
@@ -791,7 +791,7 @@
791 {791 {
792 store::Item* posItem = static_cast<const const_expr*>(posExpr)->get_val();792 store::Item* posItem = static_cast<const const_expr*>(posExpr)->get_val();
793793
794 xs_integer pos = posItem->getIntegerValue();;794 xs_integer pos( posItem->getIntegerValue() );
795795
796 if (inputExpr->get_expr_kind() == relpath_expr_kind)796 if (inputExpr->get_expr_kind() == relpath_expr_kind)
797 {797 {
@@ -799,14 +799,14 @@
799799
800 csize numSteps = pathExpr->numSteps();800 csize numSteps = pathExpr->numSteps();
801801
802 if (pos > Integer(0) && numSteps == 2)802 if (pos.sign() > 0 && numSteps == 2)
803 {803 {
804 xs_long pos2;804 xs_long pos2;
805 try805 try
806 {806 {
807 pos2 = posItem->getLongValue();807 pos2 = posItem->getLongValue();
808 }808 }
809 catch (std::range_error&)809 catch (std::range_error const&)
810 {810 {
811 goto done;811 goto done;
812 }812 }
813813
=== modified file 'src/types/casting.cpp'
--- src/types/casting.cpp 2013-05-09 00:21:51 +0000
+++ src/types/casting.cpp 2013-05-14 23:54:28 +0000
@@ -148,6 +148,45 @@
148}148}
149149
150150
151void throwFOCA0003Exception(const zstring& str, const ErrorInfo& info)
152{
153 if (info.theSourceType)
154 {
155 throw XQUERY_EXCEPTION(
156 err::FOCA0003,
157 ERROR_PARAMS(
158 str,
159 info.theSourceType->toSchemaString(),
160 info.theTargetType->toSchemaString()
161 ),
162 ERROR_LOC( info.theLoc )
163 );
164 }
165 else
166 {
167 TypeManager& tm = GENV_TYPESYSTEM;
168
169 xqtref_t sourceType =
170 tm.create_builtin_atomic_type(info.theSourceTypeCode,
171 TypeConstants::QUANT_ONE);
172
173 xqtref_t targetType =
174 tm.create_builtin_atomic_type(info.theTargetTypeCode,
175 TypeConstants::QUANT_ONE);
176
177 throw XQUERY_EXCEPTION(
178 err::FOCA0003,
179 ERROR_PARAMS(
180 str,
181 sourceType->toSchemaString(),
182 targetType->toSchemaString()
183 ),
184 ERROR_LOC( info.theLoc )
185 );
186 }
187}
188
189
151void throwFORG0001Exception(const zstring& str, const ErrorInfo& info)190void throwFORG0001Exception(const zstring& str, const ErrorInfo& info)
152{ 191{
153 if (info.theTargetType)192 if (info.theTargetType)
@@ -375,14 +414,14 @@
375{414{
376 try 415 try
377 {416 {
378 const xs_nonNegativeInteger n(strval.c_str());417 xs_nonNegativeInteger const n(strval.c_str());
379 aFactory->createNonNegativeInteger(result, n);418 aFactory->createNonNegativeInteger(result, n);
380 }419 }
381 catch (const std::invalid_argument& )420 catch ( std::invalid_argument const& )
382 {421 {
383 throwFORG0001Exception(strval, errInfo);422 throwFORG0001Exception(strval, errInfo);
384 }423 }
385 catch (const std::range_error& )424 catch ( std::range_error const& )
386 {425 {
387 RAISE_ERROR(err::FOAR0002, errInfo.theLoc, ERROR_PARAMS(strval));426 RAISE_ERROR(err::FOAR0002, errInfo.theLoc, ERROR_PARAMS(strval));
388 }427 }
@@ -954,13 +993,17 @@
954993
955T1_TO_T2(flt, int)994T1_TO_T2(flt, int)
956{995{
996 xs_float const f( aItem->getFloatValue() );
997 if ( !f.isFinite() )
998 throwFOCA0002Exception(aItem->getStringValue(), errInfo);
957 try 999 try
958 {1000 {
959 aFactory->createInteger(result, xs_integer(aItem->getFloatValue()));1001 xs_integer const n( f );
1002 aFactory->createInteger(result, n);
960 }1003 }
961 catch (const std::exception&) 1004 catch (const std::exception&)
962 {1005 {
963 throwFOCA0002Exception(aItem->getStringValue(), errInfo);1006 throwFOCA0003Exception(aItem->getStringValue(), errInfo);
964 }1007 }
965}1008}
9661009
@@ -1007,13 +1050,17 @@
10071050
1008T1_TO_T2(dbl, int)1051T1_TO_T2(dbl, int)
1009{1052{
1053 xs_double const d( aItem->getDoubleValue() );
1054 if ( !d.isFinite() )
1055 throwFOCA0002Exception(aItem->getStringValue(), errInfo);
1010 try 1056 try
1011 {1057 {
1012 aFactory->createInteger(result, xs_integer(aItem->getDoubleValue()));1058 xs_integer const n( d );
1059 aFactory->createInteger(result, n);
1013 }1060 }
1014 catch (const std::exception& ) 1061 catch (const std::exception& )
1015 {1062 {
1016 throwFOCA0002Exception(aItem->getStringValue(), errInfo);1063 throwFOCA0003Exception(aItem->getStringValue(), errInfo);
1017 }1064 }
1018}1065}
10191066
10201067
=== modified file 'src/zorbatypes/decimal.cpp'
--- src/zorbatypes/decimal.cpp 2013-05-09 00:21:51 +0000
+++ src/zorbatypes/decimal.cpp 2013-05-14 23:54:28 +0000
@@ -27,6 +27,8 @@
27#include "integer.h"27#include "integer.h"
28#include "numconversions.h"28#include "numconversions.h"
2929
30using namespace std;
31
30namespace zorba {32namespace zorba {
3133
32///////////////////////////////////////////////////////////////////////////////34///////////////////////////////////////////////////////////////////////////////
@@ -35,7 +37,7 @@
3537
36void Decimal::parse( char const *s, value_type *result, int parse_options ) {38void Decimal::parse( char const *s, value_type *result, int parse_options ) {
37 if ( !*s )39 if ( !*s )
38 throw std::invalid_argument( "empty string" );40 throw invalid_argument( "empty string" );
3941
40 s = ascii::trim_start_space( s );42 s = ascii::trim_start_space( s );
41 char const *const first_non_ws = s;43 char const *const first_non_ws = s;
@@ -58,13 +60,11 @@
58 ++s;60 ++s;
59 }61 }
60 if ( *s )62 if ( *s )
61 throw std::invalid_argument(63 throw invalid_argument( BUILD_STRING( '"', *s, "\": invalid character" ) );
62 BUILD_STRING( '"', *s, "\": invalid character" )
63 );
6464
65 if ( first_trailing_ws ) {65 if ( first_trailing_ws ) {
66 ptrdiff_t const size = first_trailing_ws - first_non_ws;66 ptrdiff_t const size = first_trailing_ws - first_non_ws;
67 char *const copy = std::strncpy( new char[ size + 1 ], first_non_ws, size );67 char *const copy = ::strncpy( new char[ size + 1 ], first_non_ws, size );
68 copy[ size ] = '\0';68 copy[ size ] = '\0';
69 *result = copy;69 *result = copy;
70 delete[] copy;70 delete[] copy;
@@ -73,98 +73,66 @@
73}73}
7474
75/**75/**
76 * Remove trailing .99999 or .000001.76 * Rounds .xxx9999xxx or .xxx000000xxx.
77 * Find four or five consecutive 9 or 0 after decimal point and eliminate them.
78 */77 */
79void Decimal::reduce( char *s ) {78void Decimal::reduce( char *s ) {
80 char *dot = strrchr( s, '.' );79 char *const dot = ::strrchr( s, '.' );
81 if ( !dot ) // not a floating point number80 if ( !dot ) // not a floating-point number
82 return;81 return;
8382
84 bool has_e = false;83 bool has_e = false;
85 char *e = strrchr( s, 'E' );84 char *e = ::strpbrk( s, "eE" );
86 if ( !e )85 if ( !e )
87 e = strrchr( s, 'e' );86 e = s + ::strlen( s ); // eliminates a special-case
88 if ( !e )
89 e = s + strlen( s );
90 else87 else
91 has_e = true;88 has_e = true;
9289 char *digit = e - 1;
93 char *digits = e - 1;90
94 for ( int pos = (int)(digits - dot); pos > 8; --pos, --digits ) {91 if ( ::strncmp( dot + 1, "9999", 3 ) == 0 ) {
95 if ( *digits == '9' ) {92 // The "leading nines" case, e.g., 12.9999[34][E56]
96 if ( digits[-1] == '9' && digits[-2] == '9' && digits[-3] == '9' ) {93 if ( has_e ) {
97 if ( ascii::is_digit( digits[1] ) && digits[1] >= '5' )94 ::memmove( dot + 2, e, strlen( e ) + 1 );
98 digits -= 4;95 dot[1] = '0';
99 else if ( digits[-4] == '9' )96 } else
100 digits -= 5;97 ::memmove( dot, e, strlen( e ) + 1 );
101 else98 digit = dot - 1;
102 continue;99 char const *const first = *s == '-' ? s + 1 : s;
103100 while ( true ) {
104 // now add 1 to remaining digits101 if ( *digit == '9' ) {
105 char *last_digit = digits;102 *digit = '0';
106 while ( digits >= s ) {103 if ( digit == first ) {
107 if ( digits[0] == '.' ) {104 // slide to the right to insert a leading '1'
108 // skip105 ::memmove( digit + 1, digit, strlen( digit ) + 1 );
109 } else if ( digits[0] == '9' ) {106 *digit = '1';
110 digits[0] = '0';107 break;
111 if ( last_digit == digits )108 }
112 --last_digit;109 --digit;
113 } else {110 } else {
114 if ( ascii::is_digit( digits[0] ) )111 ++digit[0]; // e.g., 12 => 13
115 digits[0]++;112 break;
116 break;113 }
117 }114 }
118 --digits;115 return;
119 }116 }
120 if ( last_digit[0] != '.' )117
121 ++last_digit;118 if ( char *const nines = ::strstr( dot + 1, "9999" ) ) {
122 else if ( has_e ) {119 // The "in-the-middle nines" case, e.g., 12.349999[56][E78]
123 last_digit[1] = '0';120 ++nines[-1]; // e.g., .xxx19 => .xxx29
124 last_digit += 2;121 ::memmove( nines, e, strlen( e ) + 1 );
125 }122 return;
126 if ( digits < s || !ascii::is_digit( digits[0] ) ) {123 }
127 memmove( s + 1, s, last_digit - s );124
128 ++last_digit;125 if ( char *zeros = ::strstr( dot + 1, "000000" ) ) {
129 if ( ascii::is_digit( s[0] ) )126 // The "zeros" case, e.g., 12.0000003, 12.340000005.
130 s[0] = '1';127 if ( zeros == dot + 1 && has_e )
131 else128 ++zeros; // leave one 0 after . and before E
132 s[1] = '1';129 ::memmove( zeros, e, strlen( e ) + 1 );
133 if ( has_e ) { // increment the exponent130 if ( !has_e ) {
134 ++dot;131 char *const last = s + ::strlen( s ) - 1;
135 dot[0] = dot[-1];132 if ( *last == '.' )
136 dot[-1] = '.';133 *last = '\0';
137 sprintf( e + 1, "%d", atoi( e + 1 ) + 1 );134 }
138 --last_digit;135 return;
139 }
140 }
141 int const e_len = strlen( e );
142 memmove( last_digit, e, e_len );
143 last_digit[ e_len ] = 0;
144 break;
145 }
146 } else if ( *digits == '0' ) {
147 if ( digits[-1] == '0' && digits[-2] == '0' && digits[-3] == '0' ) {
148 if ( ascii::is_digit( digits[1] ) && digits[1] < '5' )
149 digits -= 4;
150 else if ( digits[-4] == '0' )
151 digits -= 5;
152 else
153 continue;
154 while ( *digits == '0' )
155 --digits;
156 if ( *digits != '.' )
157 ++digits;
158 else if ( has_e ) {
159 digits[1] = '0';
160 digits += 2;
161 }
162 int const e_len = strlen( e );
163 memmove( digits, e, e_len );
164 digits[ e_len ] = '\0';
165 break;
166 }
167 }
168 }136 }
169}137}
170138
@@ -189,7 +157,7 @@
189 if ( f != f ||157 if ( f != f ||
190 f == std::numeric_limits<float>::infinity() ||158 f == std::numeric_limits<float>::infinity() ||
191 f == -std::numeric_limits<float>::infinity() )159 f == -std::numeric_limits<float>::infinity() )
192 throw std::invalid_argument( "float value = infinity" );160 throw invalid_argument( "float value = infinity" );
193 value_ = f;161 value_ = f;
194}162}
195163
@@ -197,19 +165,19 @@
197 if ( d != d ||165 if ( d != d ||
198 d == std::numeric_limits<double>::infinity() ||166 d == std::numeric_limits<double>::infinity() ||
199 d == -std::numeric_limits<double>::infinity() )167 d == -std::numeric_limits<double>::infinity() )
200 throw std::invalid_argument( "double value = infinity" );168 throw invalid_argument( "double value = infinity" );
201 value_ = d;169 value_ = d;
202}170}
203171
204Decimal::Decimal( Double const &d ) {172Decimal::Decimal( Double const &d ) {
205 if ( !d.isFinite() )173 if ( !d.isFinite() )
206 throw std::invalid_argument( "double value = infinity" );174 throw invalid_argument( "double value = infinity" );
207 value_ = d.getNumber();175 value_ = d.getNumber();
208}176}
209177
210Decimal::Decimal( Float const &f ) {178Decimal::Decimal( Float const &f ) {
211 if ( !f.isFinite() )179 if ( !f.isFinite() )
212 throw std::invalid_argument( "float value = infinity" );180 throw invalid_argument( "float value = infinity" );
213 value_ = f.getNumber();181 value_ = f.getNumber();
214}182}
215183
@@ -252,14 +220,14 @@
252220
253Decimal& Decimal::operator=( Double const &d ) {221Decimal& Decimal::operator=( Double const &d ) {
254 if ( !d.isFinite() )222 if ( !d.isFinite() )
255 throw std::invalid_argument( "not finite" );223 throw invalid_argument( "not finite" );
256 value_ = d.getNumber();224 value_ = d.getNumber();
257 return *this;225 return *this;
258}226}
259227
260Decimal& Decimal::operator=( Float const &f ) {228Decimal& Decimal::operator=( Float const &f ) {
261 if ( !f.isFinite() )229 if ( !f.isFinite() )
262 throw std::invalid_argument( "not finite" );230 throw invalid_argument( "not finite" );
263 value_ = f.getNumber();231 value_ = f.getNumber();
264 return *this;232 return *this;
265}233}
@@ -389,7 +357,7 @@
389 if ( value >= MAPM::getMinInt64() ) {357 if ( value >= MAPM::getMinInt64() ) {
390 // hash it as int64358 // hash it as int64
391 value.toIntegerString( bufp );359 value.toIntegerString( bufp );
392 std::stringstream ss( bufp );360 stringstream ss( bufp );
393 int64_t n;361 int64_t n;
394 ss >> n;362 ss >> n;
395 assert( ss.eof() );363 assert( ss.eof() );
@@ -400,7 +368,7 @@
400 } else if ( value <= MAPM::getMaxUInt64() ) {368 } else if ( value <= MAPM::getMaxUInt64() ) {
401 // hash it as uint64369 // hash it as uint64
402 value.toIntegerString( bufp );370 value.toIntegerString( bufp );
403 std::stringstream ss( bufp );371 stringstream ss( bufp );
404 uint64_t n;372 uint64_t n;
405 ss >> n;373 ss >> n;
406 assert( ss.eof() );374 assert( ss.eof() );
@@ -411,7 +379,7 @@
411379
412 // In all other cases, hash it as double380 // In all other cases, hash it as double
413 value.toFixPtString( bufp, ZORBA_FLOAT_POINT_PRECISION );381 value.toFixPtString( bufp, ZORBA_FLOAT_POINT_PRECISION );
414 std::stringstream ss( bufp );382 stringstream ss( bufp );
415 double n;383 double n;
416 ss >> n;384 ss >> n;
417 assert( ss.eof() );385 assert( ss.eof() );
@@ -422,7 +390,7 @@
422390
423zstring Decimal::toString( value_type const &value, bool minusZero,391zstring Decimal::toString( value_type const &value, bool minusZero,
424 int precision ) {392 int precision ) {
425 char buf[ 1024 ];393 char buf[ 2048 ];
426394
427 if ( minusZero ) {395 if ( minusZero ) {
428 if ( value.sign() == 0 )396 if ( value.sign() == 0 )
@@ -440,10 +408,9 @@
440 //408 //
441 if ( strchr( buf, '.' ) != 0 ) {409 if ( strchr( buf, '.' ) != 0 ) {
442 // remove trailing 0's410 // remove trailing 0's
443 char *last = buf + strlen( buf ) - 1;411 char *last = buf + strlen( buf );
444 while ( *last == '0' && last > buf )412 while ( *--last == '0' )
445 *last-- = '\0';413 *last = '\0';
446
447 if ( *last == '.' ) // remove '.' if no digits after it414 if ( *last == '.' ) // remove '.' if no digits after it
448 *last = '\0';415 *last = '\0';
449 }416 }
450417
=== modified file 'src/zorbatypes/floatimpl.cpp'
--- src/zorbatypes/floatimpl.cpp 2013-05-09 00:21:51 +0000
+++ src/zorbatypes/floatimpl.cpp 2013-05-14 23:54:28 +0000
@@ -130,7 +130,7 @@
130 } else if ( strncmp( s, "NaN", 3 ) == 0 ) {130 } else if ( strncmp( s, "NaN", 3 ) == 0 ) {
131 value_ = FloatImpl<FloatType>::nan().value_;131 value_ = FloatImpl<FloatType>::nan().value_;
132 s += 3;132 s += 3;
133 } else if ( strncmp( s, "+INF", 4 ) == 0 ) {133 } else if ( strncmp( s, "+INF", 4 ) == 0 ) { // allowed by XSD 1.1
134 value_ = FloatImpl<FloatType>::pos_inf().value_;134 value_ = FloatImpl<FloatType>::pos_inf().value_;
135 s += 4;135 s += 4;
136 } else136 } else
@@ -351,11 +351,7 @@
351 return "0";351 return "0";
352 if ( isNegZero() )352 if ( isNegZero() )
353 return "-0";353 return "-0";
354354 return ztd::to_string( static_cast<long long>( value_ ) );
355 // TODO: make xs_int
356 char buf[174];
357 sprintf( buf, "%d", (int)value_ );
358 return buf;
359}355}
360356
361template<typename F>357template<typename F>
@@ -379,9 +375,9 @@
379#if 1375#if 1
380 // This is the "spec" implementation, i.e., it is an exact application of376 // This is the "spec" implementation, i.e., it is an exact application of
381 // the spec in http://www.w3.org/TR/xpath-functions/#casting377 // the spec in http://www.w3.org/TR/xpath-functions/#casting
382 MAPM decimal_mapm( value_ );378 MAPM temp( value_ );
383 decimal_mapm = decimal_mapm.round( precision_ );379 temp = temp.round( precision_ );
384 return Decimal::toString( decimal_mapm, isNegZero(), max_precision() );380 return Decimal::toString( temp, isNegZero(), max_precision() );
385#else381#else
386 std::stringstream stream;382 std::stringstream stream;
387 stream.precision(7);383 stream.precision(7);
@@ -410,42 +406,37 @@
410 return result;406 return result;
411#endif407#endif
412 } else {408 } else {
413 char format[15];
414 sprintf( format, "%%#1.%dE", static_cast<int>( precision_ ) );
415
416 char buf[174];409 char buf[174];
417 sprintf( buf, format, static_cast<double>( value_ ) );410 sprintf( buf, "%#1.*E", (int)precision_, (double)value_ );
418411 char *e = ::strchr( buf, 'E' );
419 char *e = strchr( buf, 'E' );412
420 char *zeros = e ? e - 1 : buf + strlen( buf ) - 1;413 //
421414 // Clean-up, part 1: remove trailing zeros from mantissa
422 while ( *zeros == '0' )415 // e.g.: xx.xx12300Exx => xx.xx123Exx
423 --zeros;416 //
424417 char *zero = e - 1;
425 if ( e ) {418 while ( *zero == '0' && zero[-1] != '.' )
426 if ( *zeros == '.' )419 --zero;
427 ++zeros;420 if ( zero < e - 1 )
428421 ::memmove( zero + 1, e, strlen( e ) + 1 );
429 zeros[1] = 'E';422
423 //
424 // Clean-up, part 2: remove '+' and leading '0' from exponent
425 // e.g: 1E+xx => 1Exx, 1E-0x => 1E-x
426 //
427 e = ::strchr( buf, 'E' );
428 char *dest = ++e;
429 switch ( *e ) {
430 case '-':
431 ++dest;
432 // no break;
433 case '+':
434 ++e;
435 }
436 if ( *e == '0' )
430 ++e;437 ++e;
431438 if ( dest < e )
432 if ( *e == '+' )439 ::memmove( dest, e, strlen( e ) + 1 );
433 ++e;
434 else if ( *e == '-' ) {
435 ++zeros;
436 zeros[1] = '-';
437 ++e;
438 }
439
440 while ( *e == '0' )
441 ++e;
442
443 memmove( (void*)(zeros + 2), e, strlen( e ) + 1 );
444 } else {
445 if ( *zeros == '.' )
446 --zeros;
447 zeros[1] = '\0';
448 }
449440
450 Decimal::reduce( buf );441 Decimal::reduce( buf );
451 return buf;442 return buf;
452443
=== modified file 'src/zorbatypes/integer.cpp'
--- src/zorbatypes/integer.cpp 2013-05-07 00:39:46 +0000
+++ src/zorbatypes/integer.cpp 2013-05-14 23:54:28 +0000
@@ -19,7 +19,6 @@
19// standard19// standard
20#include <cerrno>20#include <cerrno>
21#include <cstdlib>21#include <cstdlib>
22#include <sstream>
2322
24// Zorba23// Zorba
25#include <zorba/internal/unique_ptr.h>24#include <zorba/internal/unique_ptr.h>
@@ -38,12 +37,6 @@
3837
39///////////////////////////////////////////////////////////////////////////////38///////////////////////////////////////////////////////////////////////////////
4039
41ostream& operator<<( ostream &o, MAPM const &m ) {
42 unique_ptr<char[]> const buf( new char[ m.exponent() + 3 ] );
43 m.toIntegerString( buf.get() );
44 return o << buf.get();
45}
46
47void integer_traits::throw_error( string const &what, bool throw_range_error ) {40void integer_traits::throw_error( string const &what, bool throw_range_error ) {
48 if ( throw_range_error )41 if ( throw_range_error )
49 throw range_error( what );42 throw range_error( what );
@@ -52,27 +45,32 @@
5245
53void integer_traits::throw_error( MAPM const &n, char const *op,46void integer_traits::throw_error( MAPM const &n, char const *op,
54 bool throw_range_error ) {47 bool throw_range_error ) {
55 ostringstream oss;48 unique_ptr<char[]> const buf( new char[ n.exponent() + 3 ] );
56 oss << n;49 n.toIntegerString( buf.get() );
57 string const what( BUILD_STRING( oss.str(), ": not ", op, " 0" ) );50 string const what( BUILD_STRING( buf.get(), ": not ", op, " 0" ) );
58 throw_error( what, throw_range_error );51 throw_error( what, throw_range_error );
59}52}
6053
61///////////////////////////////////////////////////////////////////////////////54///////////////////////////////////////////////////////////////////////////////
6255
56#ifndef ZORBA_WITH_BIG_INTEGER
57template<class T>
58typename IntegerImpl<T>::value_type IntegerImpl<T>::ftoi( double d ) {
59 value_type const v( d >= 0 ? floor( d ) : ceil( d ) );
60 if ( v < 0 && d > 0 )
61 throw range_error(
62 BUILD_STRING( '"', d, "\": value too large for integer" )
63 );
64 return v;
65}
66#endif /* ZORBA_WITH_BIG_INTEGER */
67
63template<class T>68template<class T>
64void IntegerImpl<T>::parse( char const *s, bool throw_range_error ) {69void IntegerImpl<T>::parse( char const *s, bool throw_range_error ) {
65#ifdef ZORBA_WITH_BIG_INTEGER70#ifdef ZORBA_WITH_BIG_INTEGER
66 Decimal::parse( s, &value_, Decimal::parse_integer );71 Decimal::parse( s, &value_, Decimal::parse_integer );
67#else72#else
68 try {73 value_ = ztd::aton<value_type>( s );
69 value_ = ztd::aton<value_type>( s );
70 }
71 catch ( std::range_error const &e ) {
72 if ( throw_range_error )
73 throw;
74 throw invalid_argument( e.what() );
75 }
76#endif /* ZORBA_WITH_BIG_INTEGER */74#endif /* ZORBA_WITH_BIG_INTEGER */
77 T::check_value( value_, throw_range_error );75 T::check_value( value_, throw_range_error );
78}76}
7977
=== modified file 'src/zorbatypes/integer.h'
--- src/zorbatypes/integer.h 2013-05-07 00:39:46 +0000
+++ src/zorbatypes/integer.h 2013-05-14 23:54:28 +0000
@@ -50,8 +50,6 @@
5050
51///////////////////////////////////////////////////////////////////////////////51///////////////////////////////////////////////////////////////////////////////
5252
53std::ostream& operator<<( std::ostream&, MAPM const& );
54
55struct integer_traits {53struct integer_traits {
56 static int const default_value = 0;54 static int const default_value = 0;
5755
@@ -138,6 +136,8 @@
138 }136 }
139};137};
140138
139///////////////////////////////////////////////////////////////////////////////
140
141template<class TraitsType>141template<class TraitsType>
142class IntegerImpl {142class IntegerImpl {
143public:143public:
@@ -199,6 +199,8 @@
199 *199 *
200 * @tparam TraitsType2 The traits type of \a i.200 * @tparam TraitsType2 The traits type of \a i.
201 * @param i The %IntegerImpl to copy from.201 * @param i The %IntegerImpl to copy from.
202 * @throw std::invalid_argument if \a i contains a value that is invalid for
203 * this type of integer.
202 */204 */
203 template<class TraitsType2>205 template<class TraitsType2>
204 IntegerImpl( IntegerImpl<TraitsType2> const &i );206 IntegerImpl( IntegerImpl<TraitsType2> const &i );
@@ -212,6 +214,8 @@
212 * @tparam TraitsType2 The traits type of \a i.214 * @tparam TraitsType2 The traits type of \a i.
213 * @param i The %IntegerImpl to assign from.215 * @param i The %IntegerImpl to assign from.
214 * @return Returns \c *this.216 * @return Returns \c *this.
217 * @throw std::invalid_argument if \a i contains a value that is invalid for
218 * this type of integer.
215 */219 */
216 template<class TraitsType2>220 template<class TraitsType2>
217 IntegerImpl& operator=( IntegerImpl<TraitsType2> const &i );221 IntegerImpl& operator=( IntegerImpl<TraitsType2> const &i );
@@ -552,13 +556,13 @@
552556
553 value_type value_;557 value_type value_;
554558
559#ifdef ZORBA_WITH_BIG_INTEGER
560 IntegerImpl( value_type const &v ) : value_( v ) { }
561
555 static value_type ftoi( double d ) {562 static value_type ftoi( double d ) {
556 return value_type( d >= 0 ? floor( d ) : ceil( d ) );563 return value_type( d >= 0 ? floor( d ) : ceil( d ) );
557 }564 }
558565
559#ifdef ZORBA_WITH_BIG_INTEGER
560 IntegerImpl( value_type const &v ) : value_( v ) { }
561
562 static value_type ftoi( MAPM const &d ) {566 static value_type ftoi( MAPM const &d ) {
563 return d.sign() >= 0 ? d.floor() : d.ceil();567 return d.sign() >= 0 ? d.floor() : d.ceil();
564 }568 }
@@ -573,6 +577,8 @@
573 }577 }
574#else /* ZORBA_WITH_BIG_INTEGER */578#else /* ZORBA_WITH_BIG_INTEGER */
575579
580 static value_type ftoi( double d );
581
576 static value_type ftoi( value_type v ) {582 static value_type ftoi( value_type v ) {
577 return v; // intentional no-op583 return v; // intentional no-op
578 }584 }
579585
=== modified file 'test/fots/CMakeLists.txt'
--- test/fots/CMakeLists.txt 2013-05-08 20:14:47 +0000
+++ test/fots/CMakeLists.txt 2013-05-14 23:54:28 +0000
@@ -157,8 +157,6 @@
157EXPECTED_FOTS_FAILURE (fn-available-environment-variables fn-available-environment-variables-011 0)157EXPECTED_FOTS_FAILURE (fn-available-environment-variables fn-available-environment-variables-011 0)
158EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-36 0)158EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-36 0)
159EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-37 0)159EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-37 0)
160EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-002 1090089)
161EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-002b 1090089)
162EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-005 0)160EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-005 0)
163EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-006 0)161EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-006 0)
164EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-007 0)162EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-007 0)
165163
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-01.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-01.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-01.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
11.899
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-02.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-02.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-02.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
12
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-03.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-03.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-03.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
11.6
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-04.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-04.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-04.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
110
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-05.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-05.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-05.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1-1.9
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-06.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-06.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-06.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1-2
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-07.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-07.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-07.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1-1.6
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-08.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-08.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-08.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1-10
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-09.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-09.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-09.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
11
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-10.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-10.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-10.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
11
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-11.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-11.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-11.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
11.234
02
=== added file 'test/rbkt/ExpQueryResults/zorba/numerics/xs_float-12.xml.res'
--- test/rbkt/ExpQueryResults/zorba/numerics/xs_float-12.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/numerics/xs_float-12.xml.res 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
11.9
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-01.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-01.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-01.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(1.899)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-02.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-02.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-02.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(1.999)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-03.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-03.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-03.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(1.59999)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-04.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-04.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-04.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(9.999)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-05.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-05.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-05.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(-1.89999)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-06.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-06.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-06.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(-1.999)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-07.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-07.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-07.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(-1.59999)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-08.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-08.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-08.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(-9.999)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-09.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-09.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-09.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(1.0000001)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-10.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-10.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-10.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(1.00000001)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-11.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-11.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-11.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(1.234000001)
02
=== added file 'test/rbkt/Queries/zorba/numerics/xs_float-12.xq'
--- test/rbkt/Queries/zorba/numerics/xs_float-12.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/numerics/xs_float-12.xq 2013-05-14 23:54:28 +0000
@@ -0,0 +1,1 @@
1xs:float(1.89999123)

Subscribers

People subscribed via source and target branches