2004-01-13 09:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* xharbour/source/rtl/mod.c
    ! fixed mod() function to be Clipper/DBASE III compatible
      (not the % operator) for combination of psitive and negative
      numbers
This commit is contained in:
Przemyslaw Czerpak
2005-01-13 08:30:56 +00:00
parent fb7302c76b
commit 47fed5e797
2 changed files with 11 additions and 1 deletions

View File

@@ -8,6 +8,12 @@
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2004-01-13 09:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* xharbour/source/rtl/mod.c
! fixed mod() function to be Clipper/DBASE III compatible
(not the % operator) for combination of psitive and negative
numbers
2004-01-13 08:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
+ harbour/include/hbfixdj.h

View File

@@ -76,7 +76,11 @@ HB_FUNC( MOD )
if( dBase )
{
hb_retnd( fmod( dNumber, dBase ) );
double dResult = fmod( dNumber, dBase );
if ( dResult && ( dNumber > 0 ? dBase < 0 : dBase > 0 ) )
dResult += dBase;
hb_retnd( dResult );
}
else
{