[gforth] / gforth / prim  

gforth: gforth/prim

Diff for /gforth/prim between version 1.196 and 1.197

version 1.196, Fri Oct 13 17:15:27 2006 UTC version 1.197, Sat Oct 21 22:13:48 2006 UTC
Line 809 
Line 809 
   
 /       ( n1 n2 -- n )          core    slash  /       ( n1 n2 -- n )          core    slash
 n = n1/n2;  n = n1/n2;
 if(FLOORED_DIV && ((n1^n2) < 0) && (n1%n2 != 0)) n--;  if (CHECK_DIVISION && (n2 == 0))
     throw(-10);
   if (CHECK_DIVISION && n2 == -1 && n1 == CELL_MIN)
     throw(-11);
   if (FLOORED_DIV && ((n1^n2) < 0) && (n1%n2 != 0))
     n--;
 :  :
  /mod nip ;   /mod nip ;
   
 mod     ( n1 n2 -- n )          core  mod     ( n1 n2 -- n )          core
 n = n1%n2;  n = n1%n2;
   if (CHECK_DIVISION && (n2 == 0))
     throw(-10);
   if (CHECK_DIVISION && n2 == -1 && n1 == CELL_MIN)
     throw(-11);
 if(FLOORED_DIV && ((n1^n2) < 0) && n!=0) n += n2;  if(FLOORED_DIV && ((n1^n2) < 0) && n!=0) n += n2;
 :  :
  /mod drop ;   /mod drop ;
Line 822 
Line 831 
 /mod    ( n1 n2 -- n3 n4 )              core            slash_mod  /mod    ( n1 n2 -- n3 n4 )              core            slash_mod
 n4 = n1/n2;  n4 = n1/n2;
 n3 = n1%n2; /* !! is this correct? look into C standard! */  n3 = n1%n2; /* !! is this correct? look into C standard! */
   if (CHECK_DIVISION && (n2 == 0))
     throw(-10);
   if (CHECK_DIVISION && n2 == -1 && n1 == CELL_MIN)
     throw(-11);
 if (FLOORED_DIV && ((n1^n2) < 0) && n3!=0) {  if (FLOORED_DIV && ((n1^n2) < 0) && n3!=0) {
   n4--;    n4--;
   n3+=n2;    n3+=n2;


Generate output suitable for use with a patch program
Legend:
Removed from v.1.196  
changed lines
  Added in v.1.197

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help