### Diff for /gforth/prim between versions 1.41 and 1.43

version 1.41, 1999/12/03 18:24:22 version 1.43, 2000/03/11 20:35:05
Line 496  if (n<0) Line 496  if (n<0)
else if (n>0)  else if (n>0)
n = 1;    n = 1;
:  :
rot 2dup - >r min swap -text dup   rot 2dup swap - >r min swap -text dup
IF    rdrop   IF  rdrop  ELSE  drop r> sgn  THEN ;
ELSE  drop r@ 0>  : sgn ( n -- -1/0/1 )
IF    rdrop -1   dup 0= IF EXIT THEN  0< 2* 1+ ;
ELSE  r> 1 and
THEN
THEN ;

Line 514  else if (n>0) Line 511  else if (n>0)
swap bounds   swap bounds
?DO  dup c@ I c@ = WHILE  1+  LOOP  drop 0   ?DO  dup c@ I c@ = WHILE  1+  LOOP  drop 0
ELSE  c@ I c@ - unloop  THEN  -text-flag ;   ELSE  c@ I c@ - unloop  THEN  -text-flag ;
: -text-flag ( n -- -1/0/1 )  : sgn ( n -- -1/0/1 )
dup 0< IF  drop -1  ELSE  0>  1 and  THEN  ;   dup 0= IF EXIT THEN  0< 2* 1+ ;

toupper c1 -- c2        gforth  toupper c1 -- c2        gforth
""If @i{c1} is a lower-case character (in the current locale), @i{c2}  ""If @i{c1} is a lower-case character (in the current locale), @i{c2}
Line 1869  and represents the floating-point number Line 1866  and represents the floating-point number
Float r;  Float r;
char *endconv;  char *endconv;
int sign = 0;
if(number[0]=='-') {
sign = 1;
number++;
u--;
}
while(isspace((unsigned)(number[--u])) && u>0);  while(isspace((unsigned)(number[--u])) && u>0);
switch(number[u])  switch(number[u])
{  {
Line 1884  if((flag=FLAG(!(Cell)*endconv))) Line 1887  if((flag=FLAG(!(Cell)*endconv)))
{  {
IF_FTOS(fp[0] = FTOS);     IF_FTOS(fp[0] = FTOS);
fp += -1;     fp += -1;
FTOS = r;     FTOS = sign ? -r : r;
}  }
else if(*endconv=='d' || *endconv=='D')  else if(*endconv=='d' || *endconv=='D')
{  {
Line 1894  else if(*endconv=='d' || *endconv=='D') Line 1897  else if(*endconv=='d' || *endconv=='D')
{       {
IF_FTOS(fp[0] = FTOS);          IF_FTOS(fp[0] = FTOS);
fp += -1;          fp += -1;
FTOS = r;          FTOS = sign ? -r : r;
}       }
}  }

 Removed from v.1.41 changed lines Added in v.1.43

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>