# LegacyCollector

Home | Legacy Firefox Extensions | Content Policy | Contact

# eCalculator

Author(s):

• eGust

Features

Basic Operations:
Input expression, press ENTER or click the R button.
Press ESC to clear the input text.
Press UP/DOWN to select history input.
Click the result number to put it to input text.

Numbers:
Decimal by default.
Prefix 0b for binary.
Prefix 0x for hex.
Underscore _ can be in a number ( exp. 10_000 ).

Currently supported operators
Basic:
+ : Plus (+)
- : Minus (−)
* : Times (×)
/ : Divide (÷)
% : Module
Extanded:
** : Power
// : Integer Divide
Bitwise (integers only):
~ : Bitwise NOT
& : Bitwise AND
| : Bitwise OR
^ : Bitwise XOR
Logical (true = 1, false = 0):
! : Logical NOT
&& : Logical AND
|| : Logical OR
Relational (true = 1, false = 0):
== : Equal
!= : Not equal
> : Greater than
< : Less than
>= : Greater than or Equal to
<= : Less than or Equal to
Quest (lazy version):
condition ? true value : false value
for exp.
1 >= 2 ? 10 : 20 => 20
1 ? 2 ? 3 : 4 : 5 ? 6 : 7 = 1 ? (2 ? 3 : 4) : (5 ? 6 : 7)
Operator Orders
Use ( and ) to promote orders.
1 **
2 * / % //
3 + -
4 ~ & | ^
5 ! && ||
6 == != > < >= <=
7 ? :
Variable, Constants and Functions
Assign Variable:
= a = ...
a = b = 3 => a = (b = 3)
a = 1 + (b = 2) => a = 3, b = 2
[*] A variable could be assigned to a function.
Constants:
E: 2.7182818...
PI: 3.1415926...
Functions:
abs: absolute value
ln: log based on E
lg lg10 log10: log based on 10
lg2 log2: log based on 2
log: log(number, base)
sin, cos, tan/tg, ctan/ctg: Triangle functions
ord/chr: convert between char and code.
signed/unsigned: convert interger to signed/unsigned.

Change Log
[0.5]
+ support input history (uses localStorage)
+ Options
+ functions: signed, unsigned
! fixed: negative integer bitwise operators bug.
* UI changes

[0.4]
+ functions: abs, ord, chr
! fixed: ~ < <= ?: operators bug
* UI changes

ecalculator-0.1.1-signed.xpi
ecalculator-0.4.1-signed.xpi
ecalculator-0.5.1-signed.xpi
ecalculator-0.5.1.1-signed.xpi
ecalculator-0.6.1-signed.xpi
ecalculator-0.7.0.xpi