Calculate values of mathematical expressions

Latest Version

Version
5.5
Update
October 7, 2022
Size
49.74KiB
Developer
Category
Users
102
Rating
1 ★
Manifest Version
3
Web Store Status
Languages Support
Deutsch
English
See more
Permissions
Storage
See more

calc-extension Extension

# calc-extension

(C) Martin Väth

This project is under the GNU Public License 2.0.

A WebExtension: Calculate values of mathematical expressions

The extension strives to be useful for everybody quickly needing
brief or mid-long calculations: in daily “browser” life, as a
mathematician, or as a programmer - there is support for all needs.

Formulas can be entered in the typical mathematician's or
programmer's syntax - both is understood.
There is also support for lengthy sessions
(saving/restoring, exporting to clipboard, etc).

The original motivation was to experiment with a Pratt parser.
There is already a much richer expression syntax than in most languages
(implicit multiplication signs, no braces necessary for function calls),
and it would be simple to extend the syntax to a more full-blown “language”.
(In fact, earlier versions of __calc-extension__ had a simpler syntax.
Readers interested in the parser implementation can check `data/js/parser.js`).

After installing __calc-extension__, it can be used as follows.

Click the __calc-extension__ symbol `1+2` or the link on the options page.
Then a page opens where you can enter a formula (see below) which will be
calculated when you press the solver button (`~>`).
(There is an option to use the enter key instead if you prefer.)
The result is then shown and you can enter the next formula.
You can also go back to an earlier entered formula and “recalculate” it
(e.g. after you modified some variables).
To remove a formula from your list, simply remove the main formula text
and press the solver button.

A simple formula is a usual mathematical expression which consists of numbers,
the usual operators `+` `-` `*` `/` and braces `(` `)`.
As usual in mathematics (though not in most computer languages),
it is possible to omit the multiplication sign `*`.
However:

__Be aware that `x` means the variable x and not a multiplication sign__!

For multiplication use instead one of the symbols `*` `·` `×` or simply omit it
(a space can be used to separate adjacent tokens).
The division symbol is `/` or `:`.

Numbers have the usual floating-point format, e.g. `17` `0.1` `1.2e-3`,
or they can be octal or hexadecimal: For an octal number start with `0`,
for a hexadecimal number start with `0x`.

There are further operators which can be used in expressions:

- `%` remainder (“modulo”)
- `**`or `↑` exponentiation (binds from right to left)
- `&` bitwise AND
- `|` bitwise OR
- `^` bitwise XOR

There are also some mathematical functions available.
Note that functions bind stronger than all binary operators, i.e.
`sin PI/2` is the same as `sin(PI)/2` but differs from `sin(PI/2)`.

- `sin` the sine, argument is in radians
- `cos` the cosine, argument is in radians
- `tan` the tangent, argument is in radians
- `asin` the arcsine, in radians
- `acos` the arccosine, in radians
- `atan` the arctangent, in radians
- `sinh` the hyperbolic sine
- `cosh` the hyperbolic cosine
- `tanh` the hyperbolic tangent
- `asinh` the hyperbolic areasine
- `acosh` the hyperbolic areacosine
- `atanh` the hyperbolic areatangent
- `log10` the base 10 logarithm
- `log2` the base 2 logarithm
- `log` the natural logarithm (base E)
- `log1p` `log(1+x)` where `x` is the argument
- `exp` the exponential function (base E)
- `expm1` `exp x - 1` where `x` is the argument
- `sqrt` the square root, that is `sqrt x = x ** (1/2)`
- `cbrt` the cube root, that is `cbrt x = x ** (1/3)`
- `abs` the absolute value
- `sign` the signum (1, 0, or -1)
- `floor` the value rounded down to an integer
- `ceil` the value rounded up to an integer
- `trunc` the value rounded to the integer of smaller absolute value
- `round` the value rounded to its nearest integer
- `fround` the value rounded to its nearest 32 bit float
- `clz32` the number of leading zero bits in a 32 bit representation

Furthermore, there are constants available:

- `E` Euler's number exp 1
- `PI` or `π` the circle number acos -1
- `SQRT2` sqrt 2
- `SQRT1_2` sqrt 1/2
- `LN2` log 2
- `LN10` log 10
- `LOG2E` log2 E
- `LOG10E` log10 E
- `EPSILON` or `ε` the distance of 1 to the smallest larger floating point number

Finally, it is possible to define variables with e.g. `a=...` and to use them.
Variable names must only consist of English characters, numbers, or `_`.

The names of the functions and constants and operator precedence is similar to
that of javascript. However, functions in javascript require braces, and the
multiplication sign must not omitted.

The following things are further extensions:

There is a special variable name `#` which always refers to the result of
the last (succesful) calculation.

There are also special sequences which can occur anywhere in an expression
and which cause options to switch (you can also switch them by the mouse).
To modify options more permanently (also for future sessions even across
browser restarts), you have to store them or use the preferences window.

- `'width:height'` textarea size
- `\"base\"` switch output to base (2-36)
- `!` new input fields are textareas (multiple lines)
- `?` new input fields are for single lines

The actual calculation of the functions and number conversion occurs
by javascript calls. Therefore, mathematical properties like available
precision, error messages, number limitations, and possible inaccuracies
(and possibly even bugs) are inherited from the javascript interpreter.

## Example session

- `1 + 2(1+1) + (2-1)(3-2)`
- ~> 6
- `1·1 + 1×1 + 1 1 + 1*1`
- ~> 4
- `2↑2↑3 - 2**8 + 4/3 - 1:3`
- -> 1
- `1 - cos π/2 + cos(PI/2)`
- ~> 1.5
- `a = 3(# + 1)`
- ~> 7.5
- `# + 4a`
- ~> 37.5
- `0xF | 0100 \"16\"`
- ~> 4f (in base 16)

## Permissions

The extension requires the storage permission in order to store
options/accordion state and possibly a session on local storage.

## Languages

Currently, the following languages are supported:

- en (default language)
- de
Read more

Source Manifest.json

{"update_url": "https://clients2.google.com/service/update2/crx", "name": "__MSG_extensionName__", "short_name": "calc-extension", "description": "__MSG_extensionDescription__", "author": "Martin V\u00e4th", "version": "5.5", "manifest_version": 3, "default_locale": "en", "permissions": [ "storage" ], "background": { "service_worker": "data/js/background.js" }, "action": { "default_icon": { "16": "data/icons/16.png", "32": "data/icons/32.png", "48": "data/icons/48.png", "128": "data/icons/128.png" }, "browser_style": true }, "options_ui": { "page": "data/html/options.html" }, "icons": { "16": "data/icons/16.png", "32": "data/icons/32.png", "48": "data/icons/48.png", "128": "data/icons/128.png" }}
Read more

How to download and manually install calc-extension extension for Chrome

Looking for a way to install calc-extension extensions for Chrome, you can search for them in the Chrome Web Store, clicking the "Add to Chrome" button, and following the straightforward process.

However, you may need to install calc-extension extensions manually, this article outlines two simple methods to effortlessly install calc-extension extensions, whether they come as unpacked folders in compressed formats like .zip or as .crx files.

Method 1: Download calc-extension extension and manually install through Drag &Drop

If you ever need to manually install a calc-extension extension for Chrome, don't worry, it's a simple process. Just follow these easy steps, and you will have your extension ready to use in no time.

Step 1: Download the calc-extension Extension by clicking the "Download CRX" button on the website.

Look for the calc-extension extension you wish to install. Go to the website and download the calc-extension extension package, which is usually a .CRX file and comes in a zipped file. Here ".crx" file is the format for calc-extension extension that contains all the data.

Step 2: Extract &Arrange Files

Once the file is downloaded, extract that file into its own folder. Similarly, give that extension files a permanent home. In other words, keep it in a folder that you don't accidentally delete it because these files will be needed to make that extension work.

Step 3: Go to the Chrome Extensions Page

Open Google Chrome and in the address bar, type chrome://extensions; it will open the Google Chrome extensions page. Make sure that "My extensions" is selected in the sidebar.

Step 4: Drag and Drop the Extension

Now, go to the folder where you extracted the calc-extension extension and drag &drop the extension file from there anywhere onto the extension page within Google Chrome.

Step 5: Complete the Installation

Once you drag and drop the extension file, follow the steps that Google Chrome takes you through. Similarly, if the extension file is of .crx file format, you will be required to review the permissions and then add the extension.

Now, you can manage that added extension as you would like to with any other Chrome extension that you added through Chrome Webstore. Its icon will also appear in the Google Chrome Menu on the right side of the address bar once you activate it.

Method 2: Download calc-extension extension for Chrome and install in Developer Mode

This is another method to install calc-extension extension manually, but the twist is that here, you install by enabling the developer mode option provided in Google Chrome. This mode is commonly used for testing extensions or running unpublished tools.

Step 1: Download the calc-extension extension file

Select and download the calc-extension extension by clicking the 'Download CRX' button on the website.

Step 2: Extract the downloaded contents

Convert the file to a ZIP file if it is in CRX format then extract the calc-extension extension zip file or folder that you downloaded. Make sure you extract it using the same folder name and keep it safely in another folder, so you don't delete it by mistake. The extracted folder will be needed to keep your calc-extension extension running.

Step 3: Open Chrome Extension Setting Page

In the address bar of Google Chrome, type chrome://extensions and open the Chrome Extension Page.

Step 4: Enable Developer Mode

After opening the Chrome Extension page, look at the top right side, and you will find the toggle option of "Developer mode."Simply enable that developer mode option.

Step 5: Load the Unpacked Extension

Once you enable the developer mode option, you will see the menu of Load Unpacked, Pack Extensions and Update. From that, select the option "Load unpacked."

Step 6: Select the Extension Folder

Once the pop-up opens upon clicking Load unpacked, select the calc-extension extension directory and click on the "Select Folder "button.

Step 7: Confirm and Install

After you select an extension folder of a Google Chrome extension you're installing manually, confirm its installation for the final time and let the installation complete.

Conclusion

Here we've made a step-by-step guide on How to manually install calc-extension extension in 2 ways. We hope this guide proves helpful.

Similar Extensions

icon

Rendered Maths Solver Extension · Productivity 102 1 ★ 19.2KiB

icon

Laser Search Extension · Productivity 102 0 ★ 752KiB

icon

Cursive Alphabet Extension · Social & Communication 102 1 ★ 38.87KiB

icon

FreedomCalc Extension · Productivity 102 0 ★ 281KiB

icon

Stack Overflow Unofficial Patch Extension · Productivity 102 0 ★ 51.28KiB

icon

Simple Calculator Extension · Productivity 102 0 ★ 58.37KiB

icon

Math Studio Extension · Productivity 102 4 ★ 266KiB

icon

Quadratic Equation Calculator Extension · Productivity 102 4 ★ 16.56KiB

icon

Math Suite Extension · Productivity 102 0 ★ 2.45MiB

icon

Comic Text Extension · Accessibility 102 14 ★ 30.07KiB

icon

Compact Calculator Extension · Accessibility 102 7 ★ 98.75KiB

icon

Academic Question [HEP/GR Tools] Extension · Productivity 102 4 ★ 67.8KiB

icon

Math solver Extension · Productivity 102 0 ★ 200KiB

icon

Math Extension · Productivity 102 2 ★ 10.23KiB

icon

Math Hunters: Productivity & Math Helper Extension · Productivity 102 7 ★ 2.01MiB

icon

MPL Bibliovation Extension Extension · Productivity 102 0 ★ 430KiB

icon

Maf Eqn Extension · Productivity 102 3 ★ 91.9KiB

icon

QuickLaTex Extension · Productivity 102 1 ★ 597KiB

icon

easyCalc Extension · Productivity 102 11 ★ 676KiB

icon

Math Tools Extension · Productivity 102 20 ★ 3.96MiB

icon

Deep Link Extension · Productivity 102 3 ★ 4.13KiB

icon

MathSolver Extension · Productivity 102 16 ★ 392KiB

icon

Graspable Math Sidebar Extension · Productivity 102 28 ★ 2.46MiB

icon

Mouseless Stack-Calculator Ext Extension · Productivity 102 39 ★ 148KiB