Re: geo_decls.h oopsie... - Mailing list pgsql-hackers

From Dann Corbit
Subject Re: geo_decls.h oopsie...
Date
Msg-id D90A5A6C612A39408103E6ECDD77B8290FD4E4@voyager.corporate.connx.com
Whole thread Raw
List pgsql-hackers
Probably a lot more sensible to change the interface to both functions
below to return int instead of double.

#include <float.h>
double          double_compare(double d1, double d2)
{   if (d1 > d2)       if ((d1 - d2) < fabs(d1 * DBL_EPSILON))           return 0;       else           return 1;   if
(d1< d2)       if ((d2 - d1) < fabs(d2 * DBL_EPSILON))           return 0;       else           return -1;   return 0;
 
}

float           float_compare(float d1, float d2)
{   if (d1 > d2)       if ((d1 - d2) < fabs(d1 * FLT_EPSILON))           return 0;       else           return 1;   if
(d1< d2)       if ((d2 - d1) < fabs(d2 * FLT_EPSILON))           return 0;       else           return -1;   return 0;
 
}


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: NAMEDATALEN Changes
Next
From: Tom Lane
Date:
Subject: Re: When and where to check for function permissions