File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.47 2001/06/07 00:09:29 momjian Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.48 2002/02/23 01:01:30 momjian Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -784,7 +784,9 @@ int4fac(PG_FUNCTION_ARGS)
784
784
int32 arg1 = PG_GETARG_INT32 (0 );
785
785
int32 result ;
786
786
787
- if (arg1 < 1 )
787
+ if (arg1 == 0 )
788
+ result = 1 ;
789
+ else if (arg1 < 1 )
788
790
result = 0 ;
789
791
else
790
792
for (result = 1 ; arg1 > 0 ; -- arg1 )
Original file line number Diff line number Diff line change 7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/int8.c,v 1.36 2001/11/24 19:57:06 tgl Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/int8.c,v 1.37 2002/02/23 01:01:30 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -515,7 +515,9 @@ int8fac(PG_FUNCTION_ARGS)
515
515
int64 result ;
516
516
int64 i ;
517
517
518
- if (arg1 < 1 )
518
+ if (arg1 == 0 )
519
+ result = 1 ;
520
+ else if (arg1 < 1 )
519
521
result = 0 ;
520
522
else
521
523
for (i = arg1 , result = 1 ; i > 0 ; -- i )
You can’t perform that action at this time.
0 commit comments