Formula calculator

Last updated
microMathematics Plus on Android displaying a formula for a popular Wi-Fi password challenge. The formula is entered first, and requires operator precedence -- multiplications and divisions precede additions and subtractions. Wi-Fi challenge Pi equation in microMathematics Plus 2.15.6 on Android 2.3.png
microMathematics Plus on Android displaying a formula for a popular Wi-Fi password challenge. The formula is entered first, and requires operator precedence multiplications and divisions precede additions and subtractions.

A formula calculator is a software calculator that can perform a calculation in two steps:

Contents

  1. Enter the calculation by typing it in from the keyboard.
  2. Press a single button or key to see the final result.

This is unlike button-operated calculators, such as the Windows calculator or the Mac OS X calculator, which require the user to perform one step for each operation, by pressing buttons to calculate all the intermediate values, before the final result is shown.

In this context, a formula is also known as an expression, and so formula calculators may be called expression calculators. Also in this context, calculation is known as evaluation, and so they may be called formula evaluators, rather than calculators.

How they work

Formulas as they are commonly written use infix notation for binary operators, such as addition, multiplication, division and subtraction. This notation also uses:

Also, formulas may contain:

Once a formula is entered, a formula calculator follows the above rules to produce the final result by automatically:

Types of calculator

The formula calculator concept can be applied to all types of calculator, including arithmetic, scientific, statistics, financial and conversion calculators.

The calculation can be typed or pasted into an edit box of:

It can also be entered on the command line of a programming language.

Although they are not calculators in themselves, because they have a much broader feature set, many software tools have a formula-calculation capability, in that a formula can be typed in and evaluated. These include:

Declarative and imperative tools

Button-operated calculators are imperative, because the user must provide details of how the calculation has to be performed. [1]

On the other hand, formula calculators are more declarative, because the entered formula specifies what to do, and the user does not have to provide any details of the step-by-step order in which the calculation has to be performed.

Declarative solutions are easier to understand than imperative solutions, [1] [2] and so there has been a long-term trend from imperative to declarative methods. [3] [4] Formula calculators are part of this trend.

Many software tools for the general user, such as spreadsheets, are declarative. Formula calculators are examples of such tools.

Hybrid calculators

There are hybrid calculators that combine typed-in formulae and button-operated calculation. For example:

See also

Related Research Articles

<span class="mw-page-title-main">Calculator</span> Electronic device used for calculations

An electronic calculator is typically a portable electronic device used to perform calculations, ranging from basic arithmetic to complex mathematics.

In mathematics, an operand is the object of a mathematical operation, i.e., it is the object or quantity that is operated on.

Rebol is a cross-platform data exchange language and a multi-paradigm dynamic programming language designed by Carl Sassenrath for network communications and distributed computing. It introduces the concept of dialecting: small, optimized, domain-specific languages for code and data, which is also the most notable property of the language according to its designer Carl Sassenrath:

Although it can be used for programming, writing functions, and performing processes, its greatest strength is the ability to easily create domain-specific languages or dialects

<span class="mw-page-title-main">Division (mathematics)</span> Arithmetic operation

Division is one of the four basic operations of arithmetic. The other operations are addition, subtraction, and multiplication. What is being divided is called the dividend, which is divided by the divisor, and the result is called the quotient.

In mathematics and computer programming, the order of operations is a collection of rules that reflect conventions about which operations to perform first in order to evaluate a given mathematical expression.

<span class="mw-page-title-main">Scientific calculator</span> Calculator designed to calculate problems in science, engineering, and mathematics

A scientific calculator is an electronic calculator, either desktop or handheld, designed to perform calculations using basic and complex mathematical operations and functions. They have completely replaced slide rules as well as books of mathematical tables and are used in both educational and professional settings.

In programming languages, scientific calculators and similar common operator notation or operator grammar is a way to define and analyse mathematical and other formal expressions. In this model a linear sequence of tokens are divided into two classes: operators and operands.

In programming language theory, the associativity of an operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses. If an operand is both preceded and followed by operators, and those operators have equal precedence, then the operand may be used as input to two different operations. The choice of which operations to apply the operand to, is determined by the associativity of the operators. Operators may be associative, left-associative, right-associative or non-associative. The associativity and precedence of an operator is a part of the definition of the programming language; different programming languages may have different associativity and precedence for the same type of operator.

This is a list of operators in the C and C++ programming languages. All the operators listed exist in C++; the column "Included in C", states whether an operator is also present in C. Note that C does not support operator overloading.

<span class="mw-page-title-main">Windows Calculator</span> Calculator application included in Microsoft Windows

Windows Calculator is a software calculator developed by Microsoft and included in Windows. In its Windows 10 incarnation it has four modes: standard, scientific, programmer, and a graphing mode. The standard mode includes a number pad and buttons for performing arithmetic operations. The scientific mode takes this a step further and adds exponents and trigonometric function, and programmer mode allows the user to perform operations related to computer programming. In 2020, a graphing mode was added to the Calculator, allowing users to graph equations on a coordinate plane.

bc, for basic calculator, is "an arbitrary-precision calculator language" with syntax similar to the C programming language. bc is typically used as either a mathematical scripting language or as an interactive mathematical shell.

TI-BASIC is the official name of a BASIC-like language built into Texas Instruments (TI)'s graphing calculators. TI-BASIC is a language family of three different and incompatible versions, released on different products:

<span class="mw-page-title-main">TI SR-50</span> Early scientific pocket calculator

The SR-50 was Texas Instruments' first scientific pocket calculator with trigonometric and logarithm functions. It enhanced their earlier SR-10 and SR-11 calculators, introduced in 1973, which had featured scientific notation, squares, square root, and reciprocals, but had no trig or log functions, and lacked other features. The SR-50 was introduced in 1974 and sold for US$170. It competed with the Hewlett-Packard HP-35.

<span class="mw-page-title-main">Arithmometer</span> 19th-century mechanical calculator patented by French inventor Thomas de Colmar

The arithmometer was the first digital mechanical calculator strong enough and reliable enough to be used daily in an office environment. This calculator could add and subtract two numbers directly and could perform long multiplications and divisions effectively by using a movable accumulator for the result.

In computer science, an operator precedence parser is a bottom-up parser that interprets an operator-precedence grammar. For example, most calculators use operator precedence parsers to convert from the human-readable infix notation relying on order of operations to a format that is optimized for evaluation such as Reverse Polish notation (RPN).

There are various ways in which calculators interpret keystrokes. These can be categorized into two main types:

Texas Instruments TI-36 is a series of scientific calculators distributed by Texas Instruments. It currently represents the high-end model for the TI-30 product lines.

<span class="mw-page-title-main">Software calculator</span> Calculator as a computer program

A software calculator is a calculator that has been implemented as a computer program, rather than as a physical hardware device.

<span class="mw-page-title-main">GNOME Calculator</span> Calculator software

GNOME Calculator, formerly known as gcalctool, is the software calculator integrated with the GNOME desktop environment. It is programmed in C and Vala and part of the GNOME Core Applications.

References

  1. 1 2 Harold Thimbleby. A new calculator and why it is necessary, Computing Science, Middlesex University, London, UK, September 1998. Available from: http://www.uclic.ucl.ac.uk/harold/srf/allcalcs.pdf Archived at: web.archive.org
  2. Roy E. Furman. Declarative Programming - Strategies for Solving Software Problems, http://www.articlesalley.com Archived 2012-12-20 at the Library of Congress Web Archives, July 2006. Available from: "Declarative Programming - Strategies for Solving Software Problems". Archived from the original on 2012-07-23. Retrieved 2009-05-04.
  3. David A. Watt. Programming language concepts and paradigms, Prentice Hall, 1990 (citation 13 at http://citeseer.ist.psu.edu/context/14802/0)
  4. Tatsuru Matsushita. Expressive Power of Declarative Programming Languages, PhD thesis, Department of Computer Science, University of York, October 1998 (citation 13 at http://citeseer.ist.psu.edu/context/14802/0)