2 test - whether a value is deemed to be true or false
13 This function returns 1 or 0 according as x tests as "true" or "false".
15 Conditions under which a value x is considered to be false are:
17 Numbers (real or complex): x is zero
21 Matrix: every component of x tests as false
23 List: every element of x tests as false
25 Association: x has no element
31 Object of type xx: if xx_test has been defined, xx_test(x)
32 returns zero; if xx_test has not been defined,
33 every element of x tests as false.
35 Error-value or other types: never
38 ; print test(27), test(0), test("abc"), test("")
41 ; print test(mat[3] = {1,,2}), test(mat[2][2])
45 ; print test(A), test(pop(A)), test(A), test(pop(A)), test(A)
55 isassoc, isfile, isident, isnum, isint, islist, ismat, isnull, isobj,
56 isreal, isstr, issimple, istype
58 ## Copyright (C) 1999-2006 Landon Curt Noll
60 ## Calc is open software; you can redistribute it and/or modify it under
61 ## the terms of the version 2.1 of the GNU Lesser General Public License
62 ## as published by the Free Software Foundation.
64 ## Calc is distributed in the hope that it will be useful, but WITHOUT
65 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
66 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
67 ## Public License for more details.
69 ## A copy of version 2.1 of the GNU Lesser General Public License is
70 ## distributed with calc under the filename COPYING-LGPL. You should have
71 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
72 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
74 ## @(#) $Revision: 30.1 $
75 ## @(#) $Id: test,v 30.1 2007/03/16 11:10:42 chongo Exp $
76 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/test,v $
78 ## Under source code control: 1996/07/11 01:05:13
79 ## File existed as early as: 1996
81 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
82 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/