From 19d4ba4d17cbd8a35331c33b251214bd415f7b5f Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Tue, 25 Jan 2000 21:23:18 +0000 Subject: [PATCH] See ChangeLog entry 2000-01-25 16:20 GMT-5 David G. Holm --- harbour/ChangeLog | 7 +++++++ harbour/source/rtl/itemapi.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b57e547d5f..99ad5c07de 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,10 @@ +2000-01-25 16:20 GMT-5 David G. Holm + + * source/rtl/itemapi.c + ! Don't check for infinity when checking for numeric overflow and using + a Borland C compiler, because Borland C returns 0 for log(0), which is + what is being used to set infinity. + 2000-01-25 21:47 GMT+1 Antonio Linares * source/debug/debugger.prg * Partial support for editing variables. diff --git a/harbour/source/rtl/itemapi.c b/harbour/source/rtl/itemapi.c index 224611e02c..e20507443a 100644 --- a/harbour/source/rtl/itemapi.c +++ b/harbour/source/rtl/itemapi.c @@ -1173,8 +1173,14 @@ char * hb_itemStr( PHB_ITEM pNumber, PHB_ITEM pWidth, PHB_ITEM pDec ) s_dInfinity = -log( 0 ); s_bInfinityInit = TRUE; } - - if( pNumber->item.asDouble.length == 99 || dNumber == s_dInfinity || dNumber == -s_dInfinity ) + if( pNumber->item.asDouble.length == 99 + #ifdef __BORLANDC__ + /* No more checks for Borland C, which returns 0 for log( 0 ), + and is therefore unable to test for infinity */ + #else + || dNumber == s_dInfinity || dNumber == -s_dInfinity + #endif + ) /* Numeric overflow */ iBytes = iSize + 1; else