5 #!/usr/local/src/cmd/calc/calc -q -f
13 return integer (uniary operator case)
14 integer or real (binary operator case)
17 The pound sign or sharp sign "#" has special meaning in calc.
23 returns the number of 1 bits, or pop-count of the absolute value of
24 the numerator (abs(num(value))). Therefore when x is a non-negative
25 integer , # x is the pop-count of x. And thus when x is a negative
26 integer, # x returns the pop-count of abs(x). And in the general
27 case when x is a real, # x returns the pop-count of abs(num(x)).
33 returns abs(x-y), the absolute value of the difference.
35 When two or more pound signs in a row start a comment:
38 ### this is also a comment
39 print "this will print"; ## but this will not because it is a comment
41 A pound sign followed by a bang also starts a comment:
43 #! strictly speaking, this is a comment
44 print "this is correct but not recommended" #! acts like ##
46 On POSIX / Un*X / Linux / BSD conforming systems, when an executable
47 starts with the two bytes # and !, the remainder of the 1st line
48 (up to an operating system imposed limit) is taken to be the path
49 to the shell (plus shell arguments) that is to be executed. The
50 kernel appends the filename of the executable as a final argument
53 For example, of an executable file contains:
55 #!/usr/local/src/cmd/calc/calc -q -f
56 /* NOTE: The #! above must start in column 1 of the 1st line */
57 /* The 1st line must end with -f */
58 ## Single # shell comments don't work, use two or more
61 When the above file it is executed by the kernel, it will print:
65 Such files are known to calc as cscripts. See "help cscript"
68 It is suggested that the -q be added to the first line to
69 disable the reading of the startup scripts. It is not mandatory.
71 The last argument of the first line must be -f without the filename
72 because the kernel will supply the cscript filename as a final
73 argument. The final -f also implies -s. See "help usage" for
92 ; ## this is a comment
101 cscript, unexpected, usage
103 ## Copyright (C) 2007 Landon Curt Noll
105 ## Calc is open software; you can redistribute it and/or modify it under
106 ## the terms of the version 2.1 of the GNU Lesser General Public License
107 ## as published by the Free Software Foundation.
109 ## Calc is distributed in the hope that it will be useful, but WITHOUT
110 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
111 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
112 ## Public License for more details.
114 ## A copy of version 2.1 of the GNU Lesser General Public License is
115 ## distributed with calc under the filename COPYING-LGPL. You should have
116 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
117 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
119 ## @(#) $Revision: 30.1 $
120 ## @(#) $Id: pound,v 30.1 2007/03/16 11:10:42 chongo Exp $
121 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/pound,v $
123 ## Under source code control: 2007/02/06 14:09
124 ## File existed as early as: 2007
126 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
127 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/