1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +03:00

Added nbtree operator class for NUMERIC

Jan
This commit is contained in:
Jan Wieck
1999-09-29 21:13:31 +00:00
parent a6528e08a5
commit b5c4b77283
6 changed files with 50 additions and 6 deletions

View File

@ -5,7 +5,7 @@
*
* 1998 Jan Wieck
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.19 1999/07/17 20:17:58 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.20 1999/09/29 21:13:25 wieck Exp $
*
* ----------
*/
@ -690,6 +690,34 @@ numeric_floor(Numeric num)
*/
int32
numeric_cmp(Numeric num1, Numeric num2)
{
int result;
NumericVar arg1;
NumericVar arg2;
if (num1 == NULL || num2 == NULL)
return (int32)0;
if (NUMERIC_IS_NAN(num1) || NUMERIC_IS_NAN(num2))
return (int32)0;
init_var(&arg1);
init_var(&arg2);
set_var_from_num(num1, &arg1);
set_var_from_num(num2, &arg2);
result = cmp_var(&arg1, &arg2);
free_var(&arg1);
free_var(&arg2);
return (int32)((result == 0) ? 0 : ((result < 0) ? -1 : 1));
}
bool
numeric_eq(Numeric num1, Numeric num2)
{