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

Commit58193c5

Browse files
committed
Paranoia about unordered comparisons in IEEE float math. If we are
given values that compare as unordered, make sure we reply that theyare equal, which is better than giving an arbitrary answer --- at leastit doesn't depend on which one is passed as which arg.
1 parentfc7c16f commit58193c5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.71 2001/05/03 19:00:36 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.72 2001/06/02 17:12:12 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -566,10 +566,10 @@ float4_cmp_internal(float4 a, float4 b)
566566
{
567567
if (a>b)
568568
return1;
569-
elseif (a==b)
570-
return0;
571-
else
569+
elseif (a<b)
572570
return-1;
571+
else
572+
return0;
573573
}
574574
}
575575

@@ -662,10 +662,10 @@ float8_cmp_internal(float8 a, float8 b)
662662
{
663663
if (a>b)
664664
return1;
665-
elseif (a==b)
666-
return0;
667-
else
665+
elseif (a<b)
668666
return-1;
667+
else
668+
return0;
669669
}
670670
}
671671

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp