summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-04-16 22:26:14 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-04-16 22:26:14 (GMT)
commitf429b01fe53eff471ddd77950f587430b93952f9 (patch)
tree6ce4c3f2237ddcb32e98c36424d86cfe363b23af
parentb4ba814f03345f5d6febdb189ddca5732d455fcc (diff)
downloadtcl-f429b01fe53eff471ddd77950f587430b93952f9.zip
tcl-f429b01fe53eff471ddd77950f587430b93952f9.tar.gz
tcl-f429b01fe53eff471ddd77950f587430b93952f9.tar.bz2
Math funcs might have to deal with wide ints; document this. [Bug 709720]
-rw-r--r--ChangeLog5
-rw-r--r--doc/CrtMathFnc.327
2 files changed, 25 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index f4d34d1..0372d30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-16 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/CrtMathFnc.3: Functions also have to deal with wide ints,
+ but this was not documented. [Bug 709720]
+
2003-04-15 Kevin Kenny <kennykb@acm.org>
* win/tclWinTime.c: Corrected use of types to make compilation
diff --git a/doc/CrtMathFnc.3 b/doc/CrtMathFnc.3
index 77bd681..8f2b80b 100644
--- a/doc/CrtMathFnc.3
+++ b/doc/CrtMathFnc.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: CrtMathFnc.3,v 1.5.14.1 2003/03/26 16:32:20 dgp Exp $
+'\" RCS: @(#) $Id: CrtMathFnc.3,v 1.5.14.2 2003/04/16 22:26:16 dkf Exp $
'\"
.so man.macros
.TH Tcl_CreateMathFunc 3 8.4 Tcl "Tcl Library Procedures"
@@ -73,9 +73,13 @@ to those already provided by Tcl or to replace existing functions.
If \fIname\fR doesn't already exist as a function then a new function
is created. If it does exist, then the existing function is replaced.
\fINumArgs\fR and \fIargTypes\fR describe the arguments to the function.
-Each entry in the \fIargTypes\fR array must be either TCL_INT, TCL_DOUBLE,
+Each entry in the \fIargTypes\fR array must be
+.VS 8.4
+one of TCL_INT, TCL_DOUBLE, TCL_WIDE_INT,
or TCL_EITHER to indicate whether the corresponding argument must be an
-integer, a double-precision floating value, or either, respectively.
+integer, a double-precision floating value, a wide (64-bit) integer,
+or any, respectively.
+.VE 8.4
.PP
Whenever the function is invoked in an expression Tcl will invoke
\fIproc\fR. \fIProc\fR should have arguments and result that match
@@ -92,27 +96,36 @@ When \fIproc\fR is invoked the \fIclientData\fR and \fIinterp\fR
arguments will be the same as those passed to \fBTcl_CreateMathFunc\fR.
\fIArgs\fR will point to an array of \fInumArgs\fR Tcl_Value structures,
which describe the actual arguments to the function:
+.VS 8.4
.CS
typedef struct Tcl_Value {
Tcl_ValueType \fItype\fR;
long \fIintValue\fR;
double \fIdoubleValue\fR;
+ Tcl_WideInt \fIwideValue\fR;
} Tcl_Value;
.CE
.PP
The \fItype\fR field indicates the type of the argument and is
-either TCL_INT or TCL_DOUBLE.
+one of TCL_INT, TCL_DOUBLE or TCL_WIDE_INT.
+.VE 8.4
It will match the \fIargTypes\fR value specified for the function unless
the \fIargTypes\fR value was TCL_EITHER. Tcl converts
the argument supplied in the expression to the type requested in
\fIargTypes\fR, if that is necessary.
-Depending on the value of the \fItype\fR field, the \fIintValue\fR
-or \fIdoubleValue\fR field will contain the actual value of the argument.
+Depending on the value of the \fItype\fR field, the \fIintValue\fR,
+.VS 8.4
+\fIdoubleValue\fR or \fIwideValue\fR
+.VE 8.4
+field will contain the actual value of the argument.
.PP
\fIProc\fR should compute its result and store it either as an integer
in \fIresultPtr->intValue\fR or as a floating value in
\fIresultPtr->doubleValue\fR.
-It should set also \fIresultPtr->type\fR to either TCL_INT or TCL_DOUBLE
+It should set also \fIresultPtr->type\fR to one of
+.VS 8.4
+TCL_INT, TCL_DOUBLE or TCL_WIDE_INT
+.VE 8.4
to indicate which value was set.
Under normal circumstances \fIproc\fR should return TCL_OK.
If an error occurs while executing the function, \fIproc\fR should