Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1bbe55c

Browse files
Jan WieckJan Wieck
Jan Wieck
authored and
Jan Wieck
committed
Just one more bugfix - this time in cmp_abs (cannot imagine that
taking a logarithm with a 400 digit precision worked with that bugin place).Jan
1 parentc185579 commit1bbe55c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

‎src/backend/utils/adt/numeric.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
*1998 Jan Wieck
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.7 1999/01/0412:53:23 wieck Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.8 1999/01/0417:51:58 wieck Exp $
99
*
1010
* ----------
1111
*/
@@ -3438,25 +3438,28 @@ cmp_abs(NumericVar *var1, NumericVar *var2)
34383438
intw2=var2->weight;
34393439
intstat;
34403440

3441-
while (w1>w2)
3441+
while (w1>w2&&i1<var1->ndigits)
34423442
{
34433443
if (var1->digits[i1++]!=0)return1;
34443444
w1--;
34453445
}
3446-
while (w2>w1)
3446+
while (w2>w1&&i2<var2->ndigits)
34473447
{
34483448
if (var2->digits[i2++]!=0)return-1;
34493449
w2--;
34503450
}
34513451

3452-
while (i1<var1->ndigits&&i2<var2->ndigits)
3452+
if (w1==w2)
34533453
{
3454-
stat=var1->digits[i1++]-var2->digits[i2++];
3455-
if (stat)
3454+
while (i1<var1->ndigits&&i2<var2->ndigits)
34563455
{
3457-
if (stat>0)
3458-
return1;
3459-
return-1;
3456+
stat=var1->digits[i1++]-var2->digits[i2++];
3457+
if (stat)
3458+
{
3459+
if (stat>0)
3460+
return1;
3461+
return-1;
3462+
}
34603463
}
34613464
}
34623465

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp