home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / MATHSRC.ZIP / GCVT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.3 KB  |  42 lines

  1. /*------------------------------------------------------------------------
  2.  * filename - gcvt.c
  3.  *
  4.  * function(s)
  5.  *        gcvt - converts floating-point number to a string
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #include <stdlib.h>
  18. #include <_printf.h>
  19.  
  20. /*--------------------------------------------------------------------------*
  21.  
  22. Name            gcvt - converts floating-point number to a string
  23.  
  24. Usage           char *gcvt(double value, int ndec, char *bufP);
  25.  
  26. Prototype in    stdlib.h
  27.  
  28. Description     gcvt converts  value to a  null-terminated ASCII string  in
  29.                 bufP and returns a pointer  to bufP. It attempts to produce
  30.                 ndec  significant digits  in FORTRAN  F-format if possible;
  31.                 otherwise,  E-format  (ready  for  printing)  is  returned.
  32.                 Trailing zeros may be suppressed.
  33.  
  34. Return value    gcvt returns the string pointed to by bufP.
  35.  
  36. *---------------------------------------------------------------------------*/
  37. char   *gcvt  (double value, int ndec, char *bufP )
  38. {
  39.         __realcvt (&value, ndec, bufP, 'g', 0, F_8byteFloat);
  40.         return  bufP;
  41. }
  42.