Skip to content

Commit

Permalink
Auto-update number bases above programming keypad when entering simpl…
Browse files Browse the repository at this point in the history
…e integers, even if calculate-as-you-type is deactivated; Do not exclude katal from SI units keypad button menu; Update manual; Increment version number
  • Loading branch information
hanna-kn committed Sep 18, 2023
1 parent f79822a commit fa7cb38
Show file tree
Hide file tree
Showing 34 changed files with 6,881 additions and 6,826 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-09-13 Hanna Knutsson <[email protected]>

* Auto-update number bases above programming keypad when entering simple integers, even if calculate-as-you-type is deactivated

2023-08-13 Hanna Knutsson <[email protected]>

* Make closing of application with Escape key optional (enabled by default if system tray icon is used)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dnl ----------------------
dnl | initialize autotools |---------------------------------------------------
dnl ----------------------

AC_INIT([Qalculate! (GTK UI)],[4.8.0],[],[qalculate-gtk])
AC_INIT([Qalculate! (GTK UI)],[4.8.1],[],[qalculate-gtk])
AC_CONFIG_SRCDIR([src/callbacks.cc])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)
Expand Down
12 changes: 12 additions & 0 deletions data/qalculate-gtk.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@
</provides>
<translation type="gettext">qalculate-gtk</translation>
<releases>
<release version="4.8.1" date="2023-09-18">
<description>
<p>Changes:</p>
<ul>
<li>Fix besselj() and bessely()</li>
<li>Fix display of matrices and vectors with complex number form other than rectangular (default)</li>
<li>Fix conflict between decibel units (e.g. "0dB") and duodecimal 0d… syntax (now requires at least two digits)</li>
<li>Fixes for title options in plot() function</li>
<li>Auto-update number bases above programming keypad when entering simple integers, even if calculate-as-you-type is deactivated</li>
</ul>
</description>
</release>
<release version="4.8.0" date="2023-08-21">
<description>
<p>Changes:</p>
Expand Down
2 changes: 1 addition & 1 deletion doc/C/qalculate-gtk-C.omf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<date>
2023-08-21
</date>
<version identifier="4.8.0" date="2023-08-21" description=""/>
<version identifier="4.8.1" date="2023-09-18" description=""/>
<subject category="GNOME|Applications|Accessories"/>
<description>
This is the Qalculate! manual
Expand Down
11 changes: 7 additions & 4 deletions doc/C/qalculate-gtk.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY legal SYSTEM "legal.xml">
<!ENTITY appversion "4.8.0">
<!ENTITY manrevision "4.8.0">
<!ENTITY date "August 2023">
<!ENTITY appversion "4.8.1">
<!ENTITY manrevision "4.8.1">
<!ENTITY date "September 2023">
<!ENTITY app "Qalculate!">
<!ENTITY appendixa SYSTEM "appendixa.xml">
<!ENTITY appendixb SYSTEM "appendixb.xml">
Expand Down Expand Up @@ -1858,6 +1858,9 @@ If <quote>to</quote> is not preceded by an expression, the previous result will
<para>
Similarly <quote>where</quote> (or alternatively <quote>/.</quote>) can be used at the end (but before <quote>to</quote>), for variable assignments, function replacements, etc. (e.g. <quote>x+y where x=1 and y=2</quote>, <quote>x^2=4 where x>0</quote>, and <quote>sin(5) where sin()=cos()</quote>).
</para>
<para>
Note that <quote>to</quote> and <quote>where</quote> can only be applied to the whole expression. Everything before the operator is always treated as the expression to convert (or apply replacement to), and everything after as the conversion/replacement expression, regardless of any parentheses.
</para>
</sect1>
</chapter>

Expand Down Expand Up @@ -2446,7 +2449,7 @@ Among units, &app; has support for currencies with up-to-date exchange rates. Cu
<sect1 id="qalculate-unit-conversion">
<title>Conversion</title>
<para>
Expressions can be converted to a specific unit directly in the expression entry with the <quote>to</quote> operator (right arrows, including <quote>-></quote> are also supported), which converts the left-hand expression (or the previous result) to a specified unit (e.g. <quote>5 feet + 2 inches to cm</quote> converts the result of <quote>5 feet + 2 inches</quote> to centimeters). Unit expressions may contain units, prefixes, exponents, multiplication and division. By default, no prefix will be added to units typed without prefix, but this behavior can be modified by putting a question mark in front of the unit expression (<quote>6 561 ft to m ≈ 2000 m</quote> but <quote>6 561 ft to ?m ≈ 2 km</quote>). Type <quote>to optimal</quote> to get optimal unit, <quote>to base</quote> for base units, or <quote>to mixed</quote> to force the use of mixed units (see below). The <quote>to</quote> operator can also be used for other types of result transformations (see <xref linkend="qalculate-to"/>).
Expressions can be converted to a specific unit directly in the expression entry with the <quote>to</quote> operator (right arrows, including <quote>-></quote> are also supported), which converts the left-hand expression (or the previous result) to a specified unit (e.g. <quote>5 feet + 2 inches to cm</quote> converts the result of <quote>5 feet + 2 inches</quote> to centimeters). Unit expressions may contain units, prefixes, exponents, multiplication and division. By default, no prefix will be added to units typed without prefix, but this behavior can be modified by putting a question mark in front of the unit expression (<quote>6 561 ft to m ≈ 2000 m</quote> but <quote>6 561 ft to ?m ≈ 2 km</quote>). Type <quote>to optimal</quote> to get optimal unit, <quote>to base</quote> for base units, or <quote>to mixed</quote> to force the use of mixed units (see below). Note that the conversion is always applied to the whole left-hand expression, ignoring any unmatched parentheses. The <quote>to</quote> operator can also be used for other types of result transformations (see <xref linkend="qalculate-to"/>).
</para>
<para>
Alternatively the unit conversion view can be used. It is opened using <guilabel>Conversion</guilabel>, <keycombo><keycap>Ctrl</keycap><keycap>O</keycap></keycombo>, <menuchoice><guimenu>Edit</guimenu><guimenuitem>Convert To Unit Expression...</guimenuitem></menuchoice> or <keycombo><keycap>Ctrl</keycap><keycap>T</keycap></keycombo> (the last two options moves the focus to the unit expression entry). Enter a unit expression in the text entry and press <keycap>Enter</keycap> (or click <guibutton>Convert</guibutton>), or select a unit from the list. An appropriate unit category will automatically be selected from units in the current result. If <guibutton>Continuous expression</guibutton> is checked subsequent results will automatically be converted (if the conversion view is open), and if <guibutton>Add prefix</guibutton> is checked the optimal prefix will be set for unit expressions without any prefix. A unit can be inserted directly into the expression entry from the list using middle click or the context menu.
Expand Down
2 changes: 1 addition & 1 deletion doc/html/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/html/qalc.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ <h1>QALC man page</h1>
<div class="level1"><p/><span Class="bold">Numbers</span> <br>These are the regular numbers composed by digits 0-9 and a decimal sign — a dot, or a comma if it is the default decimal point in the locale/language used. If comma is used as decimal sign, the dot is still kept as an alternative decimal sign, if not explicitly deactivated. Numbers include integers, real numbers, and complex numbers. The imaginary part of complex numbers are written with as regular number followed by the special variable "i" (can be changed to a "j"), which represents the square root of -1. Spaces between digits are ignored ("5 5 = 55"). "E" (or "e") can be considered as a shortcut for writing many zeroes and is equivalent to multiplication by 10 raised to the power of the right-hand value (e.g. "5E3 = 5000"). Sexagesimal numbers (and time) can be entered directly using colons (e.g. "5:30 = 5.5"). A number immediately preceded "0b", "0o", "0d" or "0x" are interpreted as a number with base 2, 8, 12 or 16, respectively (e.g. "0x3f = 63"). <p/><span Class="bold">Intervals</span> <br>A number interval can be entered using the interval() function, the uncertainty() function, or using "±" or "+/-" (e.g. 5±1 = uncertainty(5, 0.2) = interval(4, 6)). If the read precision option is activated, decimal numbers are interpreted as an interval between the numbers that are normally rounded to the entered number (e.g. 1.1 = 1.1±0.05). If interval calculation using variance formula is activated (default), the interval represents the standard uncertainty (deviation) of the value. <p/><span Class="bold">Vectors and Matrices</span> <br>A matrix is a two-dimensional rectangular array of mathematical objects. Vectors are matrices with only one row or column, and thus one-dimensional sequences of objects. Vectors and matrices are generated by various functions, or using syntax in the form of [1 2 3 4] and [1 2; 3 4], with columns separated by space or comma and rows separated by semi-colon, or (1, 2, 3, 4) and ((1, 2), (3, 4)). <p/><span Class="bold">Variables/Constants</span> <br>See the list of variables in the GUI manual or using the command .I list variables <p/><span Class="bold">Functions</span> <br>See the list of functions in the GUI manual or using the command .I list functions <p/><span Class="bold">Units and Prefixes</span> <br>See the list of units and prefixes in the GUI manual or using the command .I list units. Abbreviated, plural and singular forms of unit names and prefixes are generally allowed. Prefixes must be put immediately before the unit to be interpreted as prefixes (eg. 5 mm = 0.005 m, but 5 m m = 5 m^2). For convenience units allow the power operator to be left out (e.g. 5 m2 = 5 m^2), with currencies excluded. <p/><span Class="bold">Unknowns</span> <br>Unknowns are text strings without any associated value. These are temporary unknown variables with default assumptions. Unknowns can also be explicitly entered by placing a backslash (\) before a single character (e.g. 5\a + 2\b) or using quotation mark before and after a text string (e.g. 5 "apples" + 2 "bananas"). If unknowns are activated characters without any associated variable, function or unit in an expression, will be regarded as an unknown variable. <p/><span Class="bold">Date and Time</span> <br>Date/time values are specified using quoted text string (quotation marks are not needed for function arguments), using standard date and time format (YYYY-MM-DDTHH:MM:SS). Some local formats are also supported, but not recommended. The local time zone are used, unless a time zone is specified at the end of the time string (Z/UTC/GMT or +/-HH:MM). Date/time supports a small subset of arithmetic operations. The time units represents calendar time, instead of average values, when added or subtracted to a date. <p/><span Class="bold">Text</span> <br>This category represent a number of different function argument types, such as regular text and file names. They can, but do not need to be put in quotes except when containing the argument separator. <p/><span Class="bold">Comments</span> <br>All text after a hashtag (e.g. (5*2)/2 #calculating triangle area) is treated as a comment. </div>
<div class="level0"><p/>Operations and operators (word operators such as AND must be surrounded by space): </div>
<div class="level1"><p/><span Class="bold">Addition (+)</span> <p/><span Class="bold">Subtraction (-)</span> <p/><span Class="bold">Multiplication (*)</span> <p/><span Class="bold">Division (/)</span> <p/><span Class="bold">Remainder (%, rem) and modulo (%%, mod)</span> <br>Returns the remainder after division. <p/><span Class="bold">Integer division (//, div)</span> <br>Rounds the result of division towards zero. <p/><span Class="bold">Exponentiation (^, **)</span> <br>Note that x^y^z equals x^(y^z), and not (x^y)^z. Note also that for non-integer exponents with negative bases, the principal root is returned and not the real root ((-8)^(1/3) equals 1 + 1.73i, and not -2). To calculate the real root for negative values, use the cbrt() and root() functions. <p/><span Class="bold">10^x (E)</span> <p/><span Class="bold">Parenthesis ((, ))</span> <p/><span Class="bold">Parellel sum (∥, ||)</span> <br>Returns the the reciprocal value of a sum of reciprocal values. || is interpreted as parallel if units are used, otherwise as logical OR. <p/><span Class="bold">Logical operators (!, NOT, ||, OR, &&, AND, XOR, NOR, NAND)</span> <p/><span Class="bold">Bitwise operators (~, |, &, &lt;&lt;, &gt;&gt;, XOR)</span> <p/><span Class="bold">Comparison operators (=, !=, &lt;, &lt;=, &gt;, &gt;=)</span> <br>Returns 1 if expression is true and 0 if false. The x variable is isolated if the expression does not evaluate as true or false. Primarily used for equations and inequalities. <p/><span Class="bold">Dot product (.)</span> <p/><span Class="bold">Element-wise operators (.*, ./, .^)</span> <p/><span Class="bold">Save operator (:=, =)</span> <br>Saves the expression to the right of the operator as a variable or function (e.g. var1:=5, func1():=x+y, var1=ln(5)+2). If the colon is omitted the expression is calculated before it is assigned to the variable. </div>
<div class="level0"><p/><span Class="bold">Evaluation priority order:</span> parenthesis, 10^x, exponentiation, functions, bitwise NOT, logical NOT, multiplication/division/remainder, parallel sum, addition/subtraction, bitwise NOT, bitwise shift, comparisons, bitwise AND, bitwise XOR, bitwise OR, logical AND, logical OR. <p/>The evaluation of short/implicit multiplication without any multiplication sign (e.g. 5x, 5(2+3)), differs depending on the parsing mode. In the conventional mode implicit multiplication does not differ from explicit multiplication (12/2(1+2) = 12/2*3 = 18, 5x/5y = 5 * x/5 * y = xy). In the parse implicit multiplication first mode, implicit multiplication is parsed before explicit multiplication (12/2(1+2) = 12/(2 * 3) = 2, 5x/5y = (5 * x)/(5 * y) = x/y). The default adaptive mode works as the parse implicit multiplication first mode, unless spaces are found (1/5x = 1/(5 * x), but 1/5 x = (1/5) * x). In the adaptive mode unit expressions are parsed separately (5 m/5 m/s = (5 * m)/(5 * (m/s)) = 1 s). Function arguments without parentheses are an exception, where implicit multiplication in front of variables and units is parsed first regardless of mode (sqrt 2x = sqrt(2x)). <p/>In chain mode, expressions are calculated from left to right, ignoring standard order of operations, like the immediate execution mode of a traditional calculator (1+2*3 = (1+2)*3 = 9). <p/>The "to"-operator is used for unit conversion and manipulation of how the result is presented. Place " to " or a right arrow (e.g. "-&gt;") followed by one of expressions/commands the below, at the end of an expression. <p/></div>
<div class="level0"><p/><span Class="bold">Evaluation priority order:</span> parenthesis, 10^x, exponentiation, functions, bitwise NOT, logical NOT, multiplication/division/remainder, parallel sum, addition/subtraction, bitwise NOT, bitwise shift, comparisons, bitwise AND, bitwise XOR, bitwise OR, logical AND, logical OR. <p/>The evaluation of short/implicit multiplication without any multiplication sign (e.g. 5x, 5(2+3)), differs depending on the parsing mode. In the conventional mode implicit multiplication does not differ from explicit multiplication (12/2(1+2) = 12/2*3 = 18, 5x/5y = 5 * x/5 * y = xy). In the parse implicit multiplication first mode, implicit multiplication is parsed before explicit multiplication (12/2(1+2) = 12/(2 * 3) = 2, 5x/5y = (5 * x)/(5 * y) = x/y). The default adaptive mode works as the parse implicit multiplication first mode, unless spaces are found (1/5x = 1/(5 * x), but 1/5 x = (1/5) * x). In the adaptive mode unit expressions are parsed separately (5 m/5 m/s = (5 * m)/(5 * (m/s)) = 1 s). Function arguments without parentheses are an exception, where implicit multiplication in front of variables and units is parsed first regardless of mode (sqrt 2x = sqrt(2x)). <p/>In chain mode, expressions are calculated from left to right, ignoring standard order of operations, like the immediate execution mode of a traditional calculator (1+2*3 = (1+2)*3 = 9). <p/>The "to"-operator is used for unit conversion and manipulation of how the result is presented. Place " to " or a right arrow (e.g. "-&gt;") followed by one of expressions/commands listed below, at the end of an expression. <p/></div>
<div class="level0"><span Class="bold">Unit conversion</span> - a unit or unit expression (e.g. meter or km/h) <br>prepend with ? to request the optimal prefix <br>prepend with b? to request the optimal binary prefix <br>prepend with + or - to force/disable use of mixed units <br>- a variable or physical constant (e.g. c) <br>- base (convert to base units) <br>- optimal (convert to optimal unit) <br>- mixed (convert to mixed units, e.g. hours + minutes) <p/></div>
<div class="level0"><span Class="bold">Number base conversion</span> - bin, binary (show as binary number) <br>- bin# (show as binary number with specified number of bits) <br>- oct, octal (show as octal number) <br>- duo, duodecimal (show as duodecimal number) <br>- hex, hexadecimal (show as hexadecimal number) <br>- hex# (show as hexadecimal number with specified number of bits) <br>- sex, sexa2, sexa3, sexagesimal (show as sexagesimal number; sexa2 hides and sexa3 rounds arcseconds) <br>- latitude, latitude2, longitude, longitude2 (show as sexagesimal latitude/longitude; latitude2 and longitude2 hide arcseconds) <br>- bijective (shown in bijective base-26) <br>- fp16, fp32, fp64, fp80, fp128 (show in binary floating-point format) <br>- bcd (show as binary-coded decimal) <br>- roman (show as roman numerals) <br>- time (show in time format) <br>- unicode <br>- base # (show in specified number base) <br>- bases (show as binary, octal, decimal and hexadecimal number) <br><p/></div>
<div class="level0"><span Class="bold">Complex format</span> - rectangular, cartesian (show complex numbers in rectangular form) <br>- exponential (show complex numbers in exponential form) <br>- polar (show complex numbers in polar form) <br>- cis (show complex numbers in cis form) <br>- angle, phasor (show complex numbers in angle/phasor notation) <p/></div>
<div class="level0"><span Class="bold">Time and date conversion</span> - UTC (show date and time in UTC time zone) <br>- UTC+/-hh[:mm] (show date and time in specified time zone) <br>- calendars <p/></div>
<div class="level0"><span Class="bold">Other conversion commands</span> - fraction (show result as mixed fraction) <br>- factors (factorize result) <p/>Similarly where (or alternatively "/.") can be used at the end (but before "to"), for variable assignments, function replacements, etc. (e.g. "x+y where x=1 and y=2", "x^2=4 where x&gt;0", and "sin(5) where sin()=cos()"). </div><h2 class="nroffsh" id="EXAMPLES">EXAMPLES</h2>
<div class="level0"><span Class="bold">Other conversion commands</span> - fraction (show result as mixed fraction) <br>- factors (factorize result) <p/>Similarly where (or alternatively "/.") can be used at the end (but before "to"), for variable assignments, function replacements, etc. (e.g. "x+y where x=1 and y=2", "x^2=4 where x&gt;0", and "sin(5) where sin()=cos()"). <p/>Note that to and where can only be applied to the whole expression. Everything before the operator is always treated as the expression to convert (or apply replacement to), and everything after as the conversion/replacement expression, regardless of any parentheses. </div><h2 class="nroffsh" id="EXAMPLES">EXAMPLES</h2>
<div class="level0">Note that semicolon can be replaced with comma, if comma is not used as decimal or thousands separator. <p/><span Class="bold">Basic functions and operators</span> <p/></div>
<div class="level0">sqrt 4 = sqrt(4) <br>= 4^(0.5) <br>= 4^(1/2) <br>= 2 <p/></div>
<div class="level0">sqrt(25; 16; 9; 4) = [5 4 3 2] <p/></div>
Expand Down
Loading

0 comments on commit fa7cb38

Please sign in to comment.