From 421fa5fafe471eb6a1d4fdb62bb75901a611032c Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Thu, 24 Jun 1999 03:13:09 +0000 Subject: [PATCH] See ChangeLog entry 19990623-22:05 EDT David G. Holm --- harbour/ChangeLog | 44 ++++++++++++++++++++---------------- harbour/source/rtl/descend.c | 9 ++++++-- harbour/source/rtl/math.c | 3 +++ 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d2753a0174..68a1ba09dd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,9 @@ +19990623-22:05 EDT David G. Holm + Code has been added to the following two modules to return the + correct number of decimal places for floating point results. + * source/rtl/descend.c + * source/rtl/math.c + 19990623-21:50 EDT David G. Holm Oops! I accidentally left the HB_USE_STRICMP and HB_USE_STRCASECMP stuff in these two files. It's really gone now... @@ -87,7 +93,7 @@ 19990623-01:00 CET Victor Szel ! source/rtl/asort.prg - Added patch posted by + Added patch posted by Dave Pearson quicksort() is STATIC now. + source/rtl/types.h @@ -98,9 +104,9 @@ * source/compiler/harbour.l * removed some unnecessary rules * added the very begginning of MEMVAR support - + * include/compiler.h - + added pMemvars member to _FUNC structure + + added pMemvars member to _FUNC structure 19990622-14:00 CET Victor Szel * source/rdd/rdd.api moved to /include @@ -108,22 +114,22 @@ 19990621-19:09 CET Victor Szel ! source/rtl/asort.prg source/rtl/objfunc.prg - Got rid of the references to Default() + Got rid of the references to Default() + Added msgcz852.c, msgczkam.c, msgyu852.c to source/rtl/natmsg/ source/rtl/msgxxx.c posted by Davor Siklic + Added cgi.ch to tests/working/hscript/, too. + source/rtl/environ.c - Added patch posted by + Added patch posted by Dave Pearson 19990622-00:22 Ryszard Glab * config/prg.cf * config/test.cf - * corrected to support creation of executables that don't contain - extension - + * corrected to support creation of executables that don't contain + extension + 19990621-19:00 CET Ad Franse + source/rdd/rdd.api + include/compat.h; include/super.h; include/compat.h @@ -131,11 +137,11 @@ Mon Jun 21 12:14:15 1999 Gonzalo A. Diethelm - * include/Makefile: - Got rid of cgi.ch. - - * source/compiler/Makefile: - Got rid of all ^M characters. + * include/Makefile: + Got rid of cgi.ch. + + * source/compiler/Makefile: + Got rid of all ^M characters. 19990621-13:27 CET Victor Szel * source/compiler/harbour.y @@ -165,7 +171,7 @@ Mon Jun 21 12:14:15 1999 Gonzalo A. Diethelm the copyright message at the beginning, as the final text gets done, we should put similar header to each file. - ! include/hbsetup.h - USE_GTAPI was mistakenly + ! include/hbsetup.h - USE_GTAPI was mistakenly left defined. + include/errorapi.h include/error.api @@ -185,7 +191,7 @@ Mon Jun 21 12:14:15 1999 Gonzalo A. Diethelm * include/*.h Some code beatifying. * include/types.h/_PCOUNT renamed back to PCOUNT - + IT_MEMOFLAG and IT_MEMO types added to + + IT_MEMOFLAG and IT_MEMO types added to include/extend.h and include/types.h * TEST.CH moved from /include to tests/working ! include/gt.api - _gtBox double define fixed. @@ -200,8 +206,8 @@ Mon Jun 21 12:14:15 1999 Gonzalo A. Diethelm * changed invocation of 'echo' command to overcome problems with too small space for environment variables. Note also that it is possible that you will have to increase this - space at DOS startup (for example add - SHELL=c:\command.com c:\ /E:2048 /P + space at DOS startup (for example add + SHELL=c:\command.com c:\ /E:2048 /P to config.sys) * removed some variables that can be expanded directly @@ -238,7 +244,7 @@ Mon Jun 21 12:14:15 1999 Gonzalo A. Diethelm * makefile.gcc, readmake.txt, tests/tests.mk - removed from repository - replaced by GNU make (gcc.cf) - + 19990620-23:40 CET Victor Szel * source/compiler/harbour.y Finished the required modifications for the PCODE @@ -284,7 +290,7 @@ Mon Jun 21 12:14:15 1999 Gonzalo A. Diethelm * source\hbpp\hbpp.c * source\hbpp\harb.h Fixed some problems with preprocessor - + 19990620-15:50 CET Victor Szel * hb_gtBox() rewritten. It's now 100% Clipper compatible, fill character diff --git a/harbour/source/rtl/descend.c b/harbour/source/rtl/descend.c index 7adf06db7d..c3cde07b0f 100644 --- a/harbour/source/rtl/descend.c +++ b/harbour/source/rtl/descend.c @@ -5,6 +5,8 @@ #include #include +extern STACK stack; + HARBOUR HB_DESCEND(void); static SYMBOL symbols[] = { @@ -41,11 +43,14 @@ HARBOUR HB_DESCEND( void ) else if( IS_DATE( pItem ) ) hb_retnl( 5231808 - pItem->value.lDate ); else if( IS_INTEGER( pItem ) ) - hb_retnd( -1 * pItem->value.iNumber ); + hb_retni( -1 * pItem->value.iNumber ); else if( IS_LONG( pItem ) ) - hb_retnd( -1 * pItem->value.lNumber ); + hb_retnl( -1 * pItem->value.lNumber ); else if( IS_DOUBLE( pItem ) ) + { hb_retnd( -1 * pItem->value.dNumber ); + stack.Return.wDec = pItem->wDec; + } else if( IS_LOGICAL( pItem ) ) hb_retl( !pItem->value.iLogical ); else diff --git a/harbour/source/rtl/math.c b/harbour/source/rtl/math.c index 4761120760..9dc017d527 100644 --- a/harbour/source/rtl/math.c +++ b/harbour/source/rtl/math.c @@ -62,6 +62,7 @@ HARBOUR HB_ABS( void ) hb_retnd( pNumber->value.dNumber ); else hb_retnd( -pNumber->value.dNumber ); + stack.Return.wDec = pNumber->wDec; } else { @@ -187,6 +188,7 @@ HARBOUR HB_MAX( void ) { double d1 = hb_parnd(1), d2 = hb_parnd(2); hb_retnd(d1 > d2? d1: d2); + stack.Return.wDec = (d1 > d2? p1->wDec : p2->wDec); } } else @@ -225,6 +227,7 @@ HARBOUR HB_MIN( void ) { double d1 = hb_parnd(1), d2 = hb_parnd(2); hb_retnd(d1 < d2? d1: d2); + stack.Return.wDec = (d1 < d2? p1->wDec : p2->wDec); } } else