Английская Википедия:GNOME Calculator

Материал из Онлайн справочника
Перейти к навигацииПерейти к поиску

Шаблон:Short description Шаблон:Infobox 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.

Views

  • Basic – interface for basic arithmetic, resembling a desk calculator.
  • Advanced – an interface with scientific functions, and support for custom variables.
  • Financial – financial calculation and currency conversion.
  • Programming – a view with bit manipulation operators and radix conversion.
  • Keyboard – most of the space is taken up by the output, with no on-screen buttons. Supports currency and unit conversion.

Notation

The GNOME calculator uses the common infix notation for binary functions, such as the four basic arithmetic operations. Unlike many other calculators, it uses prefix notation, not postfix notation for unary functions. So to calculate e.g. the sine of one, the user must push the keys Шаблон:Keypress, not Шаблон:Keypress, as on many other calculators.

The decimal separator on the number pad is based on the general keyboard layout since version 3.12.3.[1]

Variable handling

Шаблон:Howto

Advanced, Financial, and Programming modes present features for storing and retrieving values labeled as variables. Шаблон:Keypress is the symbol for variable, used on GUI buttons Шаблон:Keypress (insert variable) and Шаблон:Keypress (assign variable).

Variable names are case-sensitive alphabetical string without spaces. Variable values are numerical strings.

Values are assigned to variable names by entering in the GUI text input/result field a variable name followed by 0 or more spaces, followed by the Шаблон:Key press character, followed by 0 or more spaces, followed by either a numeric value or an existing variable name, e.g. "x = 2" or "result = subtotal" (if subtotal was already assigned a numeric value). A numeric value is assigned to the first variable name. If the value was entered as an existing variable name rather than as a numeric value, the existing variable's value is assigned to the first variable name. Assignment to a variable name that does not exist creates the new variable by name with the assigned value. The Шаблон:Keypress (assign variable) GUI button shows a popup menu of existing variables (and the current value of each), to which selected variable is assigned the current numeric value displayed in the calculator, just as if that variable name were entered in the GUI text field followed by a Шаблон:Key press, followed by the numeric value.Шаблон:Citation needed

Entering a variable name into the GUI text field substitutes the variable value for the variable name when the expression in the GUI text field is evaluated (e.g. when the keyboard Шаблон:Key press button or the Шаблон:Key press GUI button is pressed). The Шаблон:Keypress (insert variable) GUI button shows a popup menu of existing variables (and the current value of each); the selected variable name is inserted (appended) into the GUI text field.Шаблон:Citation needed

Two predefined variables are available from the Шаблон:Keypress (insert variable) GUI button: Шаблон:Keypress and Шаблон:Keypress. ans contains the last "answer" value calculated by the calculator as a result. rand contains a random value between 0.0 and 1.0 (the value is not displayed; a rand variable is evaluated in an expression when calculating a result).

Variable names and values persist between launch and quit of the application.

See also

References

Шаблон:Reflist

External links

Шаблон:Commons category

Шаблон:GNOME