Skip to content

Commit 3514543

Browse files
author
Thomas Weise
committed
Updated Project Name + Fixed JavaDoc
SnapCI picked up some errors in my JavaDoc of class AddN: I copied source code to comments and disregarded that some characters are not allowed in HTML. The .project file seemingly named the project utils-charts. This should be fixed now.
1 parent 5f73ccc commit 3514543

File tree

2 files changed

+15
-14
lines changed
  • src/main/java/org/optimizationBenchmarking/utils/math/functions/arithmetic

2 files changed

+15
-14
lines changed

.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>utils-charts</name>
3+
<name>utils-math</name>
44
<comment>The mathematics utilities of the optimizationBenchmarking.org tool chain.</comment>
55
<projects>
66
</projects>

src/main/java/org/optimizationBenchmarking/utils/math/functions/arithmetic/AddN.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def msum(iterable):
3232
for x in iterable:
3333
i = 0
3434
for y in partials:
35-
if abs(x) < abs(y):
35+
if abs(x) &lt; abs(y):
3636
x, y = y, x
3737
hi = x + y
3838
lo = y - (hi - x)
@@ -41,7 +41,7 @@ def msum(iterable):
4141
i += 1
4242
x = hi
4343
partials[i:] = [x]
44-
return sum_exact(partials
44+
return sum_exact(partials)
4545
* </pre>
4646
* <p>
4747
* The {@code C} source code behind that method is:
@@ -64,9 +64,9 @@ def msum(iterable):
6464
PyFPE_START_PROTECT("fsum", Py_DECREF(iter); return NULL)
6565
6666
for(;;) {
67-
assert(0 <= n && n <= m);
68-
assert((m == NUM_PARTIALS && p == ps) ||
69-
(m > NUM_PARTIALS && p != NULL));
67+
assert(0 &lt;= n &amp;&amp; n &lt;= m);
68+
assert((m == NUM_PARTIALS &amp;&amp; p == ps) ||
69+
(m &gt; NUM_PARTIALS &amp;&amp; p != NULL));
7070
7171
item = PyIter_Next(iter);
7272
if (item == NULL) {
@@ -80,9 +80,9 @@ def msum(iterable):
8080
goto _fsum_error;
8181
8282
xsave = x;
83-
for (i = j = 0; j < n; j++) {
83+
for (i = j = 0; j &lt; n; j++) {
8484
y = p[j];
85-
if (fabs(x) < fabs(y)) {
85+
if (fabs(x) &lt; fabs(y)) {
8686
t = x; x = y; y = t;
8787
}
8888
hi = x + y;
@@ -106,7 +106,7 @@ def msum(iterable):
106106
special_sum += xsave;
107107
n = 0;
108108
}
109-
else if (n >= m && _fsum_realloc(&p, n, ps, &m))
109+
else if (n &gt;= m &amp;&amp; _fsum_realloc(&amp;p, n, ps, &amp;m))
110110
goto _fsum_error;
111111
else
112112
p[n++] = x;
@@ -123,20 +123,20 @@ else if (n >= m && _fsum_realloc(&p, n, ps, &m))
123123
}
124124
125125
hi = 0.0;
126-
if (n > 0) {
126+
if (n &gt; 0) {
127127
hi = p[--n];
128-
while (n > 0) {
128+
while (n &gt; 0) {
129129
x = hi;
130130
y = p[--n];
131-
assert(fabs(y) < fabs(x));
131+
assert(fabs(y) &lt; fabs(x));
132132
hi = x + y;
133133
yr = hi - x;
134134
lo = y - yr;
135135
if (lo != 0.0)
136136
break;
137137
}
138-
if (n > 0 && ((lo < 0.0 && p[n-1] < 0.0) ||
139-
(lo > 0.0 && p[n-1] > 0.0))) {
138+
if (n &gt; 0 &amp;&amp; ((lo &lt; 0.0 &amp;&amp; p[n-1] &lt; 0.0) ||
139+
(lo &gt; 0.0 &amp;&amp; p[n-1] &gt; 0.0))) {
140140
y = lo * 2.0;
141141
x = hi + y;
142142
yr = x - hi;
@@ -181,6 +181,7 @@ else if (n >= m && _fsum_realloc(&p, n, ps, &m))
181181
* (in order to deal with the fact that {@code double} has a 52 bit
182182
* mantissa and thus can only represent a subset of the 64 bit long values
183183
* accurately).</li>
184+
* </ol>
184185
* <h2>Seel Also</h2>
185186
* <ol>
186187
* <li>http://code.activestate.com/recipes/393090-binary-floating-point-

0 commit comments

Comments
 (0)