home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 2.ddi / MATH.ZIP / GCVT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.7 KB  |  44 lines

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