forked from galculator/galculator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
156 lines (121 loc) · 5.9 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
galculator
==========
a GTK 2 / GTK 3 based scientific calculator
For installation information see the INSTALL file.
For a list of shortcuts, see doc/shortcuts
There is a short man page (man galculator)
Information on Formula Entry mode can be found below.
In general, galculator's homepage galculator.sf.net is the most reliable
and up2date source of information.
RPMs: a spec file is included (galculator.spec). Thanks to Victor. Or
download at http://dag.wieers.com/packages/galculator/ (thanks to Dag Wieers)
DEBs: galculator is in DEBIAN/unstable. Thanks to seb128.
Formula Entry Mode
==================
Since version 1.2.0 galculator features a formula entry mode. This mode is one
more step towards a calculator accepting input as written on the paper.
galculator's formula entry mode aims to provide all the features of the
algebraic mode (and even to go beyond ...).
This part of galculator is developed actively. This section gives an overview
of the functions currently implemented and points out some restrictions.
Formula entry mode accepts decimal numbers as input as well as hexadecimal,
binary and octal numbers. The latter three have to be entered with a prefix:
Number base Prefix(es) Example
decimal none -3.1415
hexadecimal 0x or 0h 0xAF
binary 0b 0b1001
octal 0o 0o777
All algebraic operations and functions of the algebraic mode are supported. The
following table lists all available operations:
Operation identifier
+, -, *, / +, -, *, /
percent x%y (x percent of y) %
power x^y ^
module (MOD) mod, MOD
left shift (LSH) <<
right shift (INV + LSH) >>
AND &, and, AND
OR |, or, OR
XOR xor, XOR
Let's speak of factorial and complement as functions. Most functions' argument
has to be enclosed by brackets. Therefore sin 3 is not allowed and has to be
written as sin(3). User defined functions can be used in formula entry mode
without any restrictions!
Function Function identifier Example
Trigonometric functions:
Sine, Cosine, Tangent sin, cos, tan sin(0.5)
their inverse asin, acos, atan asin(0.5)
their hyperbolic variants sinh, cosh, tanh sinh(0.5)
and the inverse of those asinh, acosh, atanh asinh(0.5)
natural logarithm (base e) ln ln(3)
logarithm (base 10) log log(3)
square root sqrt sqrt(3)
factorial ! (3)!, 3! brackets are
optional
complement ~ ~(3) brackets are
mandatory
If formula entry mode's parser encounters an (syntax) error, the formula entry
text is turned red.
Paper Mode
==========
Since version 1.3.0 galculator features a paper mode, which offers a very
simple GUI along with the functionality of formula entry mode. In the entry
field, enter the expression following the same rules as for formula entry mode.
Hitting return or clicking the button to the right will evaluate the expression
and add it as well as the result to the list view above. Double click on any
row of that list view to copy the corresponding expression to the entry field.
User defined functions
======================
Since version 1.2.1 galculator also features user defined functions. They can
be called with the fun button next to the constant button and work like the
other function buttons like sin, cos, etc. (except that inverse and hyperbolic
are not supported). User functions can be defined in the Preferences dialog
(Functions page). The function name can be any string beginning with a letter.
So far, only a single variable is allowed. Expression gives the string
expression of the function with respect to the specified variable:
Function Name Variable Expression
f(x)=1-x f x 1-x
User defined functions can depend on other user functions:
Function Name Variable Expression
g(x)=1/(1-x)=1/f(x) g x 1/f(x)
User functions can also be called from formula entry mode.
Some random notes
=================
Left shifting is done with the LSH button.
3 << 4 "shift 3 four times to the left" 3 LSH 4 =
As a right shift is somehow the inverse of a left shift, right shifting is done
by first activating INV and than clicking the LSH button:
23 >> 5 "shift 23 five times to the right" 23 INV LSH 5
You can change number base, angle base and the notation mode by simply clicking
on the corresponding module in the display's second line. If changing from e.g.
decimal number base to binary mode results in an "inf" value on the display,
the initial value was too big. Due to the limited display length every mode
has its own limits:
decimal IEEE floating point numbers
hexadecimal -2147483648 .. 2147483647 (0h80000000 .. 0h7FFFFFFF)
octal -34359738368 .. 34359738367 (0o400000000000 .. 0o377777777777)
decimal -32768 .. 32767 (0b1000000000000000 .. 0b111111111111111)
If computing in hexadecimal, octal or binary mode, inf means that an overflow
has happened.
If in hexadecimal, octal or binary signed mode, a negative number won't be
represented with a leading minus but as 2's complement with respect to the
chosen variable length.
It is not possible to close unwanted braces straightforward. 1+((()) won't
reduce the stack of open braces, there will remain three open braces. It is
difficult to tell a "compute as soon as possible" calculator what an empty pair
of braces means: in 1+() the empty braces mean 0 (1+0=1) but in 1*() the empty
braces mean 1 (1*1=1). Therefore you have to enter a corresponding number in
order to close braces at the moment, e.g. 1+((0)) will do.
The percent operation works as "x percent of y". So if there is 37 on the
display and you press the percent button and enter 123, you get as result
37% of 123.
If you press the [EE] button the display will never become 0e+ but 1e+ instead.
There is a simple plausibility check for the character choosen as thousand's
separator: it must not be a number in the configured number base and for
a decimal number base neither decimal point nor "e" (exponent identifier
string) nor "-" (minus).
Shortcuts
=========
doc/shortcuts
http://galculator.sf.net
simon floery (simon.floery@rechenraum.com)