88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.54 2000/03/14 23:06:36 thomas Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.55 2000/03/23 07:40:00 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -830,8 +830,8 @@ dtoi4(float64 num)
830830{
831831int32 result ;
832832
833- if (!PointerIsValid ( num ) )
834- elog ( ERROR , "dtoi4: unable to convert null" );
833+ if (!num )
834+ return 0 ; /* fmgr will return NULL anyway */
835835
836836if ((* num < INT_MIN )|| (* num > INT_MAX ))
837837elog (ERROR ,"dtoi4: integer out of range" );
@@ -849,8 +849,8 @@ dtoi2(float64 num)
849849{
850850int16 result ;
851851
852- if (!PointerIsValid ( num ) )
853- elog ( ERROR , "dtoi2: unable to convert null" );
852+ if (!num )
853+ return 0 ; /* fmgr will return NULL anyway */
854854
855855if ((* num < SHRT_MIN )|| (* num > SHRT_MAX ))
856856elog (ERROR ,"dtoi2: integer out of range" );
@@ -898,8 +898,8 @@ ftoi4(float32 num)
898898{
899899int32 result ;
900900
901- if (!PointerIsValid ( num ) )
902- elog ( ERROR , "ftoi4: unable to convert null" );
901+ if (!num )
902+ return 0 ; /* fmgr will return NULL anyway */
903903
904904if ((* num < INT_MIN )|| (* num > INT_MAX ))
905905elog (ERROR ,"ftoi4: integer out of range" );
@@ -917,8 +917,8 @@ ftoi2(float32 num)
917917{
918918int16 result ;
919919
920- if (!PointerIsValid ( num ) )
921- elog ( ERROR , "ftoi2: unable to convert null" );
920+ if (!num )
921+ return 0 ; /* fmgr will return NULL anyway */
922922
923923if ((* num < SHRT_MIN )|| (* num > SHRT_MAX ))
924924elog (ERROR ,"ftoi2: integer out of range" );