Manual Pages for UNIX Darwin command on man Tcl_NewDoubleObj
MyWebUniversity

Manual Pages for UNIX Darwin command on man Tcl_NewDoubleObj

TclDoubleObj(3) Tcl Library Procedures TclDoubleObj(3)

NAME

TclNewDoubleObj, TclSetDoubleObj, TclGetDoubleFromObj - manipulate

Tcl objects as floating-point values

SYNOPSIS

##iinncclluuddee <>

TclObj * TTccllNNeewwDDoouubblleeOObbjj(doubleValue) TTccllSSeettDDoouubblleeOObbjj(objPtr, doubleValue) int TTccllGGeettDDoouubblleeFFrroommOObbjj(interp, objPtr, doublePtr) AARRGGUUMMEENNTTSS

double doubleValue (in) A double-precision floating point

value used to initialize or set a double object. TclObj *objPtr (in/out) For TTccllSSeettDDoouubblleeOObbjj, this points to the object to be converted to

double type. For TTccllGGeettDDoouubbllee-

FFrroommOObbjj, this refers to the object from which to get a double value; if objPtr does not already point to a double object, an attempt will be made to convert it to one.

TclInterp *interp (in/out) If an error occurs during conver-

sion, an error message is left in the interpreter's result object unless interp is NULL.

double *doublePtr (out) Points to place to store the dou-

ble value obtained from objPtr.

DESCRIPTION

These procedures are used to create, modify, and read double Tcl objects from C code. TTccllNNeewwDDoouubblleeOObbjj and TTccllSSeettDDoouubblleeOObbjj 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-pre-

cision floating point value given by doubleValue; TTccllNNeewwDDoouubblleeOObbjj 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 dou-

ble value to the object's internal representation doubleValue member. TTccllSSeettDDoouubblleeOObbjj invalidates any old string representation and, if the

object is not already a double object, frees any old internal represen-

tation. TTccllGGeettDDoouubblleeFFrroommOObbjj attempts to return a double value from the Tcl object objPtr. 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 TTCCLLEERRRROORR and leaves an error message in the interpreter's result object unless interp is NULL. Otherwise, it returns TTCCLLOOKK and stores the double value in the address given by doublePtr. If the object is not already a double object, the conversion will free any old internal representation.

SEE ALSO

TclNewObj, TclDecrRefCount, TclIncrRefCount, TclGetObjResult KKEEYYWWOORRDDSS double, double object, double type, internal representation, object, object type, string representation Tcl 8.0 TclDoubleObj(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™