home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcl2-73c.zip / tcl7.3 / doc / PrintDbl.3 < prev    next >
Text File  |  1993-06-05  |  2KB  |  59 lines

  1. '\"
  2. '\" Copyright (c) 1989-1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/PrintDbl.3,v 1.2 93/06/05 15:32:01 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS Tcl_PrintDouble tclc 7.0
  25. .BS
  26. .SH NAME
  27. Tcl_PrintDouble \- Convert floating value to string
  28. .SH SYNOPSIS
  29. .nf
  30. \fB#include <tcl.h>\fR
  31. .sp
  32. \fBTcl_PrintDouble\fR(\fIinterp, value, dst\fR)
  33. .SH ARGUMENTS
  34. .AS Tcl_Interp *interp
  35. .AP Tcl_Interp *interp in
  36. Interpreter that controls the conversion.
  37. .AP double value in
  38. Floating-point value to be converted.
  39. .AP char *dst out
  40. Where to store string representing \fIvalue\fR.  Must have at
  41. least TCL_DOUBLE_SPACE characters of storage.
  42. .BE
  43.  
  44. .SH DESCRIPTION
  45. .PP
  46. \fBTcl_PrintDouble\fR generates a string that represents the value
  47. of \fIvalue\fR and stores it in memory at the location given by
  48. \fIdst\fR.  It uses %g format to generate the string, with two
  49. special twists.  First, the string is guaranteed to contain either
  50. a ``.'' or an ``e'' so that it doesn't look like an integer (where
  51. %g would generate an integer with no decimal point, \fBTcl_PrintDouble\fR
  52. adds ``.0'').  Second, the number of significant digits printed at
  53. \fIdst\fR is controlled by the \fBtcl_precision\fR variable in
  54. \fIinterp\fR;  if \fBtcl_precision\fR is undefined then 6 significant
  55. digits are printed.
  56.  
  57. .SH KEYWORDS
  58. conversion, double-precision, floating-point, string
  59.