Diff for /gforth/engine/ecvt.c between versions 1.4 and 1.6

version 1.4, 1999/03/28 16:10:03 version 1.6, 2000/09/23 15:06:07
Line 1 Line 1
 /* cheap ecvt replacement  /* cheap ecvt replacement
   
   Copyright (C) 1998 Free Software Foundation, Inc.    Copyright (C) 1998,2000 Free Software Foundation, Inc.
   
   This file is part of Gforth.    This file is part of Gforth.
   
Line 56  char* ecvt(double x, int len, int* exp, Line 56  char* ecvt(double x, int len, int* exp,
    for(i=0; i < len; i++)     for(i=0; i < len; i++)
      {       {
         z=floor(x);          z=floor(x);
           if(z<0) z = 0;
         scratch[i]='0'+(char)((int)z);          scratch[i]='0'+(char)((int)z);
         x = (x-z)*10;          x = (x-z)*10;
      }       }
Line 94  int main(int argc, char ** argv) Line 95  int main(int argc, char ** argv)
    printf("ecvt Test: %f -> %s, %d, %d\n",9e0,conv,a,b);     printf("ecvt Test: %f -> %s, %d, %d\n",9e0,conv,a,b);
 }  }
 #endif  #endif
   

Removed from v.1.4  
changed lines
  Added in v.1.6


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