Re: [HACKERS] [COMMITTERS] pgsql: Check for ERANGE in exp() as well.

2007-01-06 Thread Stefan Kaltenbrunner
Bruce Momjian wrote:
 Log Message:
 ---
 Check for ERANGE in exp() as well.

this broke the regression tests on a number of boxes:

http://buildfarm.postgresql.org/cgi-bin/show_status.pl

example:

http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=spongedt=2007-01-06%2015:30:02


Stefan

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] [COMMITTERS] pgsql: Check for ERANGE in exp()

2007-01-06 Thread Bruce Momjian
Stefan Kaltenbrunner wrote:
 Bruce Momjian wrote:
  Log Message:
  ---
  Check for ERANGE in exp() as well.
 
 this broke the regression tests on a number of boxes:
 
 http://buildfarm.postgresql.org/cgi-bin/show_status.pl
 
 example:
 
 http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=spongedt=2007-01-06%2015:30:02

Thanks.  This is something I wanted to ask Tom about today.  I was
worried that ERANGE could be generated by underflow as well as overflow,
and setting result to Inf would not work for underflow.  I have applied
the following patch to test for != 0 and != Inf, which should elimintate
the underflow case.

Tom, on HPPA, does ERANGE get set for both overflow and underflow?  I
assume only overflow.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: src/backend/utils/adt/float.c
===
RCS file: /cvsroot/pgsql/src/backend/utils/adt/float.c,v
retrieving revision 1.145
diff -c -c -r1.145 float.c
*** src/backend/utils/adt/float.c	6 Jan 2007 15:18:02 -	1.145
--- src/backend/utils/adt/float.c	6 Jan 2007 20:15:22 -
***
*** 1459,1465 
  		else
  			result = 1;
  	}
! 	else if (errno == ERANGE  !isinf(result))
  		result = get_float8_infinity();
  	
  	CHECKFLOATVAL(result, isinf(arg1) || isinf(arg2), arg1 == 0);
--- 1459,1465 
  		else
  			result = 1;
  	}
! 	else if (errno == ERANGE  result != 0  !isinf(result))
  		result = get_float8_infinity();
  	
  	CHECKFLOATVAL(result, isinf(arg1) || isinf(arg2), arg1 == 0);
***
*** 1478,1484 
  
  	errno = 0;
  	result = exp(arg1);
! 	if (errno == ERANGE  !isinf(result))
  		result = get_float8_infinity();
  
  	CHECKFLOATVAL(result, isinf(arg1), false);
--- 1478,1484 
  
  	errno = 0;
  	result = exp(arg1);
! 	if (errno == ERANGE  result != 0  !isinf(result))
  		result = get_float8_infinity();
  
  	CHECKFLOATVAL(result, isinf(arg1), false);

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] [COMMITTERS] pgsql: Check for ERANGE in exp()

2007-01-06 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes:
 Tom, on HPPA, does ERANGE get set for both overflow and underflow?  I
 assume only overflow.

Yeah, AFAICT exp() just returns zero for underflow cases.  I get

regression=# select exp(-2000);
ERROR:  value out of range: underflow

but I was getting that before your last patch, too.

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [COMMITTERS] pgsql: Check for ERANGE in exp()

2007-01-06 Thread Bruce Momjian
Tom Lane wrote:
 Bruce Momjian [EMAIL PROTECTED] writes:
  Tom, on HPPA, does ERANGE get set for both overflow and underflow?  I
  assume only overflow.
 
 Yeah, AFAICT exp() just returns zero for underflow cases.  I get
 
 regression=# select exp(-2000);
 ERROR:  value out of range: underflow
 
 but I was getting that before your last patch, too.

Uh, if you were getting that before my last patch, then I don't think
you return ERANGE for underflow.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings