Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/DoubleObj.3 @ 42

Last change on this file since 42 was 25, checked in by landauf, 17 years ago

added tcl to libs

File size: 2.7 KB
RevLine 
[25]1'\"
2'\" Copyright (c) 1996-1997 Sun Microsystems, Inc.
3'\"
4'\" See the file "license.terms" for information on usage and redistribution
5'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6'\"
7'\" RCS: @(#) $Id: DoubleObj.3,v 1.4 2006/04/25 17:15:25 dgp Exp $
8'\"
9.so man.macros
10.TH Tcl_DoubleObj 3 8.0 Tcl "Tcl Library Procedures"
11.BS
12.SH NAME
13Tcl_NewDoubleObj, Tcl_SetDoubleObj, Tcl_GetDoubleFromObj \- manipulate Tcl objects as floating-point values
14.SH SYNOPSIS
15.nf
16\fB#include <tcl.h>\fR
17.sp
18Tcl_Obj *
19\fBTcl_NewDoubleObj\fR(\fIdoubleValue\fR)
20.sp
21\fBTcl_SetDoubleObj\fR(\fIobjPtr, doubleValue\fR)
22.sp
23int
24\fBTcl_GetDoubleFromObj\fR(\fIinterp, objPtr, doublePtr\fR)
25.SH ARGUMENTS
26.AS Tcl_Interp doubleValue in/out
27.AP double doubleValue in
28A double-precision floating-point value used to initialize or set a Tcl object.
29.AP Tcl_Obj *objPtr in/out
30For \fBTcl_SetDoubleObj\fR, this points to the object in which to store a
31double value.
32For \fBTcl_GetDoubleFromObj\fR, this refers to the object
33from which to retrieve a double value.
34.AP Tcl_Interp *interp in/out
35When non-NULL, an error message is left here when double value retrieval fails.
36.AP double *doublePtr out
37Points to place to store the double value obtained from \fIobjPtr\fR.
38.BE
39
40.SH DESCRIPTION
41.PP
42These procedures are used to create, modify, and read Tcl objects that
43hold double-precision floating-point values.
44.PP
45\fBTcl_NewDoubleObj\fR creates and returns a new Tcl object initialized to
46the double value \fIdoubleValue\fR.  The returned Tcl object is unshared.
47.PP
48\fBTcl_SetDoubleObj\fR sets the value of an existing Tcl object pointed to
49by \fIobjPtr\fR to the double value \fIdoubleValue\fR.  The \fIobjPtr\fR
50argument must point to an unshared Tcl object.  Any attempt to set the value
51of a shared Tcl object violates Tcl's copy-on-write policy.  Any existing
52string representation or internal representation in the unshared Tcl object
53will be freed as a consequence of setting the new value.
54.PP
55\fBTcl_GetDoubleFromObj\fR attempts to retreive a double value from the
56Tcl object \fIobjPtr\fR.  If the attempt succeeds, then \fBTCL_OK\fR is
57returned, and the double value is written to the storage pointed to by
58\fIdoublePtr\fR.  If the attempt fails, then \fBTCL_ERROR\fR is returned,
59and if \fIinterp\fR is non-NULL, an error message is left in \fIinterp\fR.
60The \fBTcl_ObjType\fR of \fIobjPtr\fR may be changed to make subsequent
61calls to \fBTcl_GetDoubleFromObj\fR more efficient.
62'\" TODO: add discussion of treatment of NaN value
63.SH "SEE ALSO"
64Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult
65.SH KEYWORDS
66double, double object, double type, internal representation, object, object type, string representation
Note: See TracBrowser for help on using the repository browser.