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

Arithmetic Elementary branch of mathematics

Arithmetic is a branch of mathematics that consists of the study of numbers, especially concerning the properties of the traditional operations on them—addition, subtraction, multiplication, division, exponentiation, and extraction of roots. Arithmetic is an elementary part of number theory, and number theory is considered to be one of the top-level divisions of modern mathematics, along with algebra, geometry, and analysis. The terms arithmetic and higher arithmetic were used until the beginning of the 20th century as synonyms for number theory, and are sometimes still used to refer to a wider part of number theory.

Calculator 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.

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

Division (mathematics) Arithmetic operation

Division is one of the four basic operations of arithmetic, the ways that numbers are combined to make new numbers. The other operations are addition, subtraction, and multiplication.

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

The plus and minus signs, + and , are mathematical symbols used to represent the notions of positive and negative, respectively. In addition, + represents the operation of addition, which results in a sum, while represents subtraction, resulting in a difference. Their use has been extended to many other meanings, more or less analogous. Plus and minus are Latin terms meaning "more" and "less", respectively.

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 languages, 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.

In mathematics, an expression or mathematical expression is a finite combination of symbols that is well-formed according to rules that depend on the context. Mathematical symbols can designate numbers (constants), variables, operations, functions, brackets, punctuation, and grouping to help determine order of operations and other aspects of logical syntax.

Windows Calculator Calculator application included in Microsoft Windows

Windows Calculator is a software calculator developed by Microsoft and included in Windows. 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. Recently, 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 SR-50 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.

Arithmometer 19th-century mechanical calculator patented by French inventor Thomas de Colmar

The Arithmometer or Arithmomètre 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.

Software calculator

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

GNOME Calculator

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: "Archived copy". Archived from the original on 2012-07-23. Retrieved 2009-05-04.CS1 maint: archived copy as title (link)
  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)