DoubleObj.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" 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.
- '"
- '" RCS: @(#) $Id: DoubleObj.3,v 1.2 1998/09/14 18:39:48 stanton Exp $
- '"
- .so man.macros
- .TH Tcl_DoubleObj 3 8.0 Tcl "Tcl Library Procedures"
- .BS
- .SH NAME
- Tcl_NewDoubleObj, Tcl_SetDoubleObj, Tcl_GetDoubleFromObj - manipulate Tcl objects as floating-point values
- .SH SYNOPSIS
- .nf
- fB#include <tcl.h>fR
- .sp
- Tcl_Obj *
- fBTcl_NewDoubleObjfR(fIdoubleValuefR)
- .sp
- fBTcl_SetDoubleObjfR(fIobjPtr, doubleValuefR)
- .sp
- int
- fBTcl_GetDoubleFromObjfR(fIinterp, objPtr, doublePtrfR)
- .SH ARGUMENTS
- .AS Tcl_Interp doubleValue in/out
- .AP double doubleValue in
- A double-precision floating point value used to initialize or set a double object.
- .AP Tcl_Obj *objPtr in/out
- For fBTcl_SetDoubleObjfR, this points to the object to be converted
- to double type.
- For fBTcl_GetDoubleFromObjfR, this refers to the object
- from which to get a double value;
- if fIobjPtrfR does not already point to a double object,
- an attempt will be made to convert it to one.
- .AP Tcl_Interp *interp in/out
- If an error occurs during conversion,
- an error message is left in the interpreter's result object
- unless fIinterpfR is NULL.
- .AP double *doublePtr out
- Points to place to store the double value
- obtained from fIobjPtrfR.
- .BE
- .SH DESCRIPTION
- .PP
- These procedures are used to create, modify, and read
- double Tcl objects from C code.
- fBTcl_NewDoubleObjfR and fBTcl_SetDoubleObjfR
- will create a new object of double type
- or modify an existing object to have double type.
- Both of these procedures set the object to have the
- double-precision floating point value given by fIdoubleValuefR;
- fBTcl_NewDoubleObjfR returns a pointer to a newly created object
- with reference count zero.
- Both procedures set the object's type to be double
- and assign the double value to the object's internal representation
- fIdoubleValuefR member.
- fBTcl_SetDoubleObjfR invalidates any old string representation
- and, if the object is not already a double object,
- frees any old internal representation.
- .PP
- fBTcl_GetDoubleFromObjfR attempts to return a double value
- from the Tcl object fIobjPtrfR.
- If the object is not already a double object,
- it will attempt to convert it to one.
- If an error occurs during conversion, it returns fBTCL_ERRORfR
- and leaves an error message in the interpreter's result object
- unless fIinterpfR is NULL.
- Otherwise, it returns fBTCL_OKfR and stores the double value
- in the address given by fIdoublePtrfR.
- If the object is not already a double object,
- the conversion will free any old internal representation.
- .SH "SEE ALSO"
- Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult
- .SH KEYWORDS
- double, double object, double type, internal representation, object, object type, string representation