modified: diffout.py
[GalaxyCodeBases.git] / c_cpp / etc / calc / help / size
blobc09878cbdb01573bcc20468cec9442471da9fa0d
1 NAME
2     size - number of elements in value
4 SYNOPSIS
5     size(x)
7 TYPES
8     x           any
10     return      integer
12 DESCRIPTION
13     For the different types of value x may have, size(x) is defined as follows:
15         null            0
16         real number     1
17         complex number  1
18         string          length of string (not counding the trailing \0)
19         matrix          number of elements
20         list            number of members
21         association     number of (elements, value) pairs
22         object          value returned by xx_size(x) if x of type xx
23         file            length of the file in octets
24         rand state      1
25         random state    1
26         config state    1
27         hash state      1
28         block           numer of octets of data it currently holds
29         octet           1
30         named block     numer of octets of data it currently holds
32 EXAMPLE
33     ; print size(null()), size(3), size(2 - 7i), size("abc")
34     0 1 1 1
36     ; mat M[2,3]
37     ; print size(M), size(list()), size(list(2,3,4))
38     6 0 3
40     ; A = assoc()
41     ; A[1] = 3, A[1,2] = 6, A["three"] = 5
42     ; print size(A)
43     3
45     ; obj point {x,y}
46     ; obj point P = {4,-5}
47     ; define point_size(a) = abs(a.x) + abs(a.y)
48     ; print size(P)
49     9
51 LIMITS
52     none
54 LINK LIBRARY
55     none
57 SEE ALSO
58      list, mat, assoc, obj, sizeof, memsize
60 ## Copyright (C) 1999-2006  Landon Curt Noll
62 ## Calc is open software; you can redistribute it and/or modify it under
63 ## the terms of the version 2.1 of the GNU Lesser General Public License
64 ## as published by the Free Software Foundation.
66 ## Calc is distributed in the hope that it will be useful, but WITHOUT
67 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
68 ## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
69 ## Public License for more details.
71 ## A copy of version 2.1 of the GNU Lesser General Public License is
72 ## distributed with calc under the filename COPYING-LGPL.  You should have
73 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
74 ## 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
76 ## @(#) $Revision: 30.1 $
77 ## @(#) $Id: size,v 30.1 2007/03/16 11:10:42 chongo Exp $
78 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/size,v $
80 ## Under source code control:   1994/03/19 03:13:22
81 ## File existed as early as:    1994
83 ## chongo <was here> /\oo/\     http://www.isthe.com/chongo/
84 ## Share and enjoy!  :-)        http://www.isthe.com/chongo/tech/comp/calc/