~ubuntu-branches/ubuntu/quantal/hexer/quantal

« back to all changes in this revision

Viewing changes to myc.1

  • Committer: Bazaar Package Importer
  • Author(s): Peter Mathiasson
  • Date: 2003-06-19 09:48:34 UTC
  • Revision ID: james.westby@ubuntu.com-20030619094834-t127jo9kd93shx02
Tags: upstream-0.1.4c
ImportĀ upstreamĀ versionĀ 0.1.4c

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" myc.1       01/12/1996
 
2
.\"
 
3
.\" Copyright (c) 1995,1996 Sascha Demetrio
 
4
.\" All rights reserved.
 
5
.\"
 
6
.\" Redistribution and use in source and binary forms, with or without
 
7
.\" modification, are permitted provided that the following conditions
 
8
.\" are met:
 
9
.\" 1. Redistributions of source code must retain the above copyright
 
10
.\"    notice, this list of conditions and the following disclaimer.
 
11
.\"    If you modify any part of HEXER and redistribute it, you must add
 
12
.\"    a notice to the `README' file and the modified source files containing
 
13
.\"    information about the  changes you made.  I do not want to take
 
14
.\"    credit or be blamed for your modifications.
 
15
.\" 2. Redistributions in binary form must reproduce the above copyright
 
16
.\"    notice, this list of conditions and the following disclaimer in the
 
17
.\"    documentation and/or other materials provided with the distribution.
 
18
.\"    If you modify any part of HEXER and redistribute it in binary form,
 
19
.\"    you must supply a `README' file containing information about the
 
20
.\"    changes you made.
 
21
.\" 3. The name of the developer may not be used to endorse or promote
 
22
.\"    products derived from this software without specific prior written
 
23
.\"    permission.
 
24
.\"
 
25
.\" HEXER WAS DEVELOPED BY SASCHA DEMETRIO.
 
26
.\" THIS SOFTWARE SHOULD NOT BE CONSIDERED TO BE A COMMERCIAL PRODUCT.
 
27
.\" THE DEVELOPER URGES THAT USERS WHO REQUIRE A COMMERCIAL PRODUCT
 
28
.\" NOT MAKE USE OF THIS WORK.
 
29
.\"
 
30
.\" DISCLAIMER:
 
31
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND
 
32
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
33
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
34
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE DEVELOPER BE LIABLE
 
35
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
36
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 
37
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
38
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
39
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 
40
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
41
.\" SUCH DAMAGE.
 
42
.\" 
 
43
.TH MYC 1 "1996 February 11" "Myc"
 
44
.\"
 
45
.\" --- Section -- NAME -------------------------------------------------------
 
46
.\"
 
47
.SH NAME
 
48
myc \- a simple calculator
 
49
.\"
 
50
.\" --- Section -- SYNOPSIS ---------------------------------------------------
 
51
.\"
 
52
.SH SYNOPSIS
 
53
.B myc
 
54
[command]
 
55
.\"
 
56
.\" --- Section -- DESCRIPTION ------------------------------------------------
 
57
.\"
 
58
.SH DESCRIPTION
 
59
.B Myc
 
60
is a simple calculator capable of all operations available in C.
 
61
Commands are entered in infix notation.  It is possible to use parentheses.
 
62
If a
 
63
.BR myc -command
 
64
is specified on the command-line, the result is echoed and
 
65
.B myc
 
66
exits immediately.
 
67
If invoked with no arguments,
 
68
.B myc
 
69
starts reading commands from standard-in.
 
70
.B myc
 
71
understands the following binary infix operators (from highest priority to
 
72
lowest):
 
73
.B **
 
74
(power),
 
75
.B *
 
76
(multiply),
 
77
.B /
 
78
(divide),
 
79
.B %
 
80
(modulo),
 
81
.B +
 
82
(add),
 
83
.B -
 
84
(subtract),
 
85
.B <<
 
86
(shift left),
 
87
.B >>
 
88
(shift right),
 
89
.B <
 
90
(less),
 
91
.B <=
 
92
(less or equal),
 
93
.B >
 
94
(greater),
 
95
.B >=
 
96
(greater or equal),
 
97
.B ==
 
98
(equal),
 
99
.B !=
 
100
(not equal),
 
101
.B &
 
102
(arithmetical and),
 
103
.B |
 
104
(arithmetical or),
 
105
.B ^
 
106
(arithmetical exclusive or),
 
107
.B &&
 
108
(logical and),
 
109
.B ||
 
110
(logical or),
 
111
.B =
 
112
(assign);  and the following unary prefix operators:
 
113
.B -
 
114
(negate, unary minus),
 
115
.B !
 
116
(logical not),
 
117
.B ~
 
118
(bitwise complement).
 
119
.B myc
 
120
knows three data types:
 
121
.BR boolean ,
 
122
.B integer
 
123
(32 bit),
 
124
.B float
 
125
(64 bit, equivalent to C double).
 
126
On some esoteric platforms the precision of integer and float may be
 
127
different.
 
128
As in C the result of a division depends on the data types of the operands.
 
129
An integer divided by an integer yields an integer.
 
130
If you want the result to be a float, make sure one of the operands is a
 
131
float, e.g. type
 
132
.I 4/7.
 
133
instead of
 
134
.I 4/7
 
135
or
 
136
.I a/(b+0.)
 
137
instead of
 
138
.IR a/b .
 
139
The power operation returns a float if the result is too large to fit in an
 
140
integer.
 
141
The result of a calculation is stored in the special variables
 
142
.B $$
 
143
and
 
144
.BI $ n
 
145
where
 
146
.I n
 
147
is the number of the command.
 
148
.\"
 
149
.\" --- Section -- BUGS -------------------------------------------------------
 
150
.\"
 
151
.SH BUGS
 
152
Maybe.  Please report bugs to
 
153
.IR demetrio@cs.uni-sb.de .
 
154
.\"
 
155
.\" --- Section -- COPYRIGHT --------------------------------------------------
 
156
.\"
 
157
.SH COPYRIGHT
 
158
.B myc
 
159
is
 
160
.BR "not in the public domain" ,
 
161
but freely distributable.  It may be used for any non-commercial purpose.
 
162
See file
 
163
.B COPYRIGHT
 
164
for details.
 
165
.\"
 
166
.\" --- Section -- AUTHOR -----------------------------------------------------
 
167
.\"
 
168
.SH AUTHOR
 
169
Sascha Demetrio
 
170
.br
 
171
.I demetrio@cs.uni-sb.de
 
172