summaryrefslogtreecommitdiffstats
path: root/doc/mathfunc.n
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-05-25 16:13:16 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-05-25 16:13:16 (GMT)
commit17da6ea9da2761c0e93da57cbbd779ec138e7a39 (patch)
tree5f85fe1c5270262b37c3b75c16728b3c5cc54428 /doc/mathfunc.n
parentf4ce59d358e3993aa45141bf6f1c37c1166ae2ec (diff)
downloadtcl-17da6ea9da2761c0e93da57cbbd779ec138e7a39.zip
tcl-17da6ea9da2761c0e93da57cbbd779ec138e7a39.tar.gz
tcl-17da6ea9da2761c0e93da57cbbd779ec138e7a39.tar.bz2
TIP#182 IMPLEMENTATION [Patch 1165062]
* doc/mathfunc.n: New built-in math function bool(). * generic/tclBasic.c: * tests/expr.test: * tests/info.test:
Diffstat (limited to 'doc/mathfunc.n')
-rw-r--r--doc/mathfunc.n25
1 files changed, 17 insertions, 8 deletions
diff --git a/doc/mathfunc.n b/doc/mathfunc.n
index f5b11b6..9f5d10a 100644
--- a/doc/mathfunc.n
+++ b/doc/mathfunc.n
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: mathfunc.n,v 1.3 2005/05/12 21:21:14 kennykb Exp $
+'\" RCS: @(#) $Id: mathfunc.n,v 1.4 2005/05/25 16:13:17 dgp Exp $
'\"
.so man.macros
.TH mathfunc n 8.5 Tcl "Tcl Mathematical Functions"
@@ -27,6 +27,8 @@ package require \fBTcl 8.5\fR
.br
\fB::tcl::mathfunc::atan2\fR \fIy\fR \fIx\fR
.br
+\fB::tcl::mathfunc::bool\fR \fIarg\fR
+.br
\fB::tcl::mathfunc::ceil\fR \fIarg\fR
.br
\fB::tcl::mathfunc::cos\fR \fIarg\fR
@@ -85,13 +87,13 @@ Tcl supports the following mathematical functions in expressions, all
of which work solely with floating-point numbers unless otherwise noted:
.DS
.ta 3c 6c 9c
-\fBabs\fR \fBcosh\fR \fBlog\fR \fBsqrt\fR
-\fBacos\fR \fBdouble\fR \fBlog10\fR \fBsrand\fR
-\fBasin\fR \fBexp\fR \fBpow\fR \fBtan\fR
-\fBatan\fR \fBfloor\fR \fBrand\fR \fBtanh\fR
-\fBatan2\fR \fBfmod\fR \fBround\fR \fBwide\fR
+\fBabs\fR \fBcos\fR \fBint\fR \fBsinh\fR
+\fBacos\fR \fBcosh\fR \fBlog\fR \fBsqrt\fR
+\fBasin\fR \fBdouble\fR \fBlog10\fR \fBsrand\fR
+\fBatan\fR \fBexp\fR \fBpow\fR \fBtan\fR
+\fBatan2\fR \fBfloor\fR \fBrand\fR \fBtanh\fR
+\fBbool\fR \fBfmod\fR \fBround\fR \fBwide\fR
\fBceil\fR \fBhypot\fR \fBsin\fR
-\fBcos\fR \fBint\fR \fBsinh\fR
.DE
.PP
.TP
@@ -116,6 +118,13 @@ Returns the arc tangent of \fIy\fR/\fIx\fR, in the range [\fI-pi\fR,\fIpi\fR]
radians. \fIx\fR and \fIy\fR cannot both be 0. If \fIx\fR is greater
than \fI0\fR, this is equivalent to \fBatan(\fIy/x\fB)\fR.
.TP
+\fBbool(\fIarg\fB)\fR
+Accepts any numerical value, or any string acceptable to
+\fBstring is boolean\fR, and returns the corresponding
+boolean value \fB0\fR or \fB1\fR. Non-zero numbers are true.
+Other numbers are false. Non-numeric strings produce boolean value in
+agreement with \fBstring is true\fR and \fBstring is false\fR.
+.TP
\fBceil(\fIarg\fB)\fR
Returns the smallest integral floating-point value (i.e. with a zero
fractional part) not less than \fIarg\fR.
@@ -218,4 +227,4 @@ Copyright (c) 1993 The Regents of the University of California.
.br
Copyright (c) 1994-2000 Sun Microsystems Incorporated.
.br
-Copyright (c) 2005 by Kevin B. Kenny <kennykb@acm.org>. All rights reserved. \ No newline at end of file
+Copyright (c) 2005 by Kevin B. Kenny <kennykb@acm.org>. All rights reserved.