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=sponge&dt=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]
  EnterpriseDB    http://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 -0000	1.145
--- src/backend/utils/adt/float.c	6 Jan 2007 20:15:22 -0000
***************
*** 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

Reply via email to