diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-09-22 18:57:19 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-09-22 18:57:19 (GMT) |
commit | 2aff4a96fa0286d875bddec0019648e2c6431cbc (patch) | |
tree | f7a9a4800a3f3ad4b77470b8383529176d8b7181 /tcl8.6/doc/PrintDbl.3 | |
parent | 3fa8e6dc88e8041b6cb88d1b1e9c05676d3346b7 (diff) | |
parent | 29ccecd87709feda60d191f6aaba324ccad91f55 (diff) | |
download | blt-2aff4a96fa0286d875bddec0019648e2c6431cbc.zip blt-2aff4a96fa0286d875bddec0019648e2c6431cbc.tar.gz blt-2aff4a96fa0286d875bddec0019648e2c6431cbc.tar.bz2 |
Merge commit '29ccecd87709feda60d191f6aaba324ccad91f55' as 'tcl8.6'
Diffstat (limited to 'tcl8.6/doc/PrintDbl.3')
-rw-r--r-- | tcl8.6/doc/PrintDbl.3 | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tcl8.6/doc/PrintDbl.3 b/tcl8.6/doc/PrintDbl.3 new file mode 100644 index 0000000..730794f --- /dev/null +++ b/tcl8.6/doc/PrintDbl.3 @@ -0,0 +1,51 @@ +'\" +'\" Copyright (c) 1989-1993 The Regents of the University of California. +'\" Copyright (c) 1994-1997 Sun Microsystems, Inc. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +.TH Tcl_PrintDouble 3 8.0 Tcl "Tcl Library Procedures" +.so man.macros +.BS +.SH NAME +Tcl_PrintDouble \- Convert floating value to string +.SH SYNOPSIS +.nf +\fB#include <tcl.h>\fR +.sp +\fBTcl_PrintDouble\fR(\fIinterp, value, dst\fR) +.SH ARGUMENTS +.AS Tcl_Interp *interp out +.AP Tcl_Interp *interp in +Before Tcl 8.0, the \fBtcl_precision\fR variable in this interpreter +controlled the conversion. As of Tcl 8.0, this argument is ignored and +the conversion is controlled by the \fBtcl_precision\fR variable +that is now shared by all interpreters. +.AP double value in +Floating-point value to be converted. +.AP char *dst out +Where to store the string representing \fIvalue\fR. Must have at +least \fBTCL_DOUBLE_SPACE\fR characters of storage. +.BE +.SH DESCRIPTION +.PP +\fBTcl_PrintDouble\fR generates a string that represents the value +of \fIvalue\fR and stores it in memory at the location given by +\fIdst\fR. It uses \fB%g\fR format to generate the string, with one +special twist: the string is guaranteed to contain either a +.QW . +or an +.QW e +so that it does not look like an integer. Where \fB%g\fR would +generate an integer with no decimal point, \fBTcl_PrintDouble\fR adds +.QW .0 . +.PP +If the \fBtcl_precision\fR value is non-zero, the result will have +precisely that many digits of significance. If the value is zero +(the default), the result will have the fewest digits needed to +represent the number in such a way that \fBTcl_NewDoubleObj\fR +will generate the same number when presented with the given string. +IEEE semantics of rounding to even apply to the conversion. +.SH KEYWORDS +conversion, double-precision, floating-point, string |