Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/PrintDbl.3 @ 37

Last change on this file since 37 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 1.9 KB
Line 
1'\"
2'\" Copyright (c) 1989-1993 The Regents of the University of California.
3'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
4'\"
5'\" See the file "license.terms" for information on usage and redistribution
6'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7'\"
8'\" RCS: @(#) $Id: PrintDbl.3,v 1.11 2007/12/13 15:22:31 dgp Exp $
9'\"
10.so man.macros
11.TH Tcl_PrintDouble 3 8.0 Tcl "Tcl Library Procedures"
12.BS
13.SH NAME
14Tcl_PrintDouble \- Convert floating value to string
15.SH SYNOPSIS
16.nf
17\fB#include <tcl.h>\fR
18.sp
19\fBTcl_PrintDouble\fR(\fIinterp, value, dst\fR)
20.SH ARGUMENTS
21.AS Tcl_Interp *interp out
22.AP Tcl_Interp *interp in
23Before Tcl 8.0, the \fBtcl_precision\fR variable in this interpreter
24controlled the conversion.  As of Tcl 8.0, this argument is ignored and
25the conversion is controlled by the \fBtcl_precision\fR variable
26that is now shared by all interpreters.
27.AP double value in
28Floating-point value to be converted.
29.AP char *dst out
30Where to store the string representing \fIvalue\fR.  Must have at
31least \fBTCL_DOUBLE_SPACE\fR characters of storage.
32.BE
33
34.SH DESCRIPTION
35.PP
36\fBTcl_PrintDouble\fR generates a string that represents the value
37of \fIvalue\fR and stores it in memory at the location given by
38\fIdst\fR.  It uses \fB%g\fR format to generate the string, with one
39special twist: the string is guaranteed to contain either a
40.QW .
41or an
42.QW e
43so that it does not look like an integer.  Where \fB%g\fR would
44generate an integer with no decimal point, \fBTcl_PrintDouble\fR adds
45.QW .0 .
46.VS 8.5
47.PP
48If the \fBtcl_precision\fR value is non-zero, the result will have
49precisely that many digits of significance.  If the value is zero
50(the default), the result will have the fewest digits needed to
51represent the number in such a way that \fBTcl_NewDoubleObj\fR
52will generate the same number when presented with the given string.
53IEEE semantics of rounding to even apply to the conversion.
54.VE
55
56.SH KEYWORDS
57conversion, double-precision, floating-point, string
Note: See TracBrowser for help on using the repository browser.