diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2016-10-18 17:31:11 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2016-10-18 17:31:11 (GMT) |
commit | 066971b1e6e77991d9161bb0216a63ba94ea04f9 (patch) | |
tree | 6de02f79b7a4bb08a329581aa67b444fb9001bfd /tcl8.6/doc/DoubleObj.3 | |
parent | ba065c2de121da1c1dfddd0aa587d10e7e150f05 (diff) | |
parent | 9966985d896629eede849a84f18e406d1164a16c (diff) | |
download | blt-066971b1e6e77991d9161bb0216a63ba94ea04f9.zip blt-066971b1e6e77991d9161bb0216a63ba94ea04f9.tar.gz blt-066971b1e6e77991d9161bb0216a63ba94ea04f9.tar.bz2 |
Merge commit '9966985d896629eede849a84f18e406d1164a16c' as 'tcl8.6'
Diffstat (limited to 'tcl8.6/doc/DoubleObj.3')
-rw-r--r-- | tcl8.6/doc/DoubleObj.3 | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tcl8.6/doc/DoubleObj.3 b/tcl8.6/doc/DoubleObj.3 new file mode 100644 index 0000000..85e4de5 --- /dev/null +++ b/tcl8.6/doc/DoubleObj.3 @@ -0,0 +1,64 @@ +'\" +'\" Copyright (c) 1996-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_DoubleObj 3 8.0 Tcl "Tcl Library Procedures" +.so man.macros +.BS +.SH NAME +Tcl_NewDoubleObj, Tcl_SetDoubleObj, Tcl_GetDoubleFromObj \- manipulate Tcl values as floating-point values +.SH SYNOPSIS +.nf +\fB#include <tcl.h>\fR +.sp +Tcl_Obj * +\fBTcl_NewDoubleObj\fR(\fIdoubleValue\fR) +.sp +\fBTcl_SetDoubleObj\fR(\fIobjPtr, doubleValue\fR) +.sp +int +\fBTcl_GetDoubleFromObj\fR(\fIinterp, objPtr, doublePtr\fR) +.SH ARGUMENTS +.AS Tcl_Interp doubleValue in/out +.AP double doubleValue in +A double-precision floating-point value used to initialize or set a Tcl value. +.AP Tcl_Obj *objPtr in/out +For \fBTcl_SetDoubleObj\fR, this points to the value in which to store a +double value. +For \fBTcl_GetDoubleFromObj\fR, this refers to the value +from which to retrieve a double value. +.AP Tcl_Interp *interp in/out +When non-NULL, an error message is left here when double value retrieval fails. +.AP double *doublePtr out +Points to place to store the double value obtained from \fIobjPtr\fR. +.BE + +.SH DESCRIPTION +.PP +These procedures are used to create, modify, and read Tcl values that +hold double-precision floating-point values. +.PP +\fBTcl_NewDoubleObj\fR creates and returns a new Tcl value initialized to +the double value \fIdoubleValue\fR. The returned Tcl value is unshared. +.PP +\fBTcl_SetDoubleObj\fR sets the value of an existing Tcl value pointed to +by \fIobjPtr\fR to the double value \fIdoubleValue\fR. The \fIobjPtr\fR +argument must point to an unshared Tcl value. Any attempt to set the value +of a shared Tcl value violates Tcl's copy-on-write policy. Any existing +string representation or internal representation in the unshared Tcl value +will be freed as a consequence of setting the new value. +.PP +\fBTcl_GetDoubleFromObj\fR attempts to retrieve a double value from the +Tcl value \fIobjPtr\fR. If the attempt succeeds, then \fBTCL_OK\fR is +returned, and the double value is written to the storage pointed to by +\fIdoublePtr\fR. If the attempt fails, then \fBTCL_ERROR\fR is returned, +and if \fIinterp\fR is non-NULL, an error message is left in \fIinterp\fR. +The \fBTcl_ObjType\fR of \fIobjPtr\fR may be changed to make subsequent +calls to \fBTcl_GetDoubleFromObj\fR more efficient. +'\" TODO: add discussion of treatment of NaN value +.SH "SEE ALSO" +Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult +.SH KEYWORDS +double, double value, double type, internal representation, value, value type, string representation |