• Stars
    star
    266
  • Rank 154,103 (Top 4 %)
  • Language
    C++
  • License
    GNU General Publi...
  • Created over 3 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Qalculate! Qt UI

Qalculate! is a multi-purpose cross-platform desktop calculator. It is simple to use but provides power and versatility normally reserved for complicated math packages, as well as useful tools for everyday needs (such as currency conversion and percent calculation). Features include a large library of customizable functions, unit calculations and conversion, symbolic calculations (including integrals and equations), arbitrary precision, uncertainty propagation, interval arithmetic, plotting, and a user-friendly interface (GTK, Qt, and CLI).

Requirements

  • Qt5 (>= 5.6) or Qt6
  • libqalculate (>= 4.7.0)

Installation

Instructions and download links for installers, binaries packages, and the source code of released versions of Qalculate! are available at https://qalculate.github.io/downloads.html.

In a terminal window in the top source code directory run

  • qmake
  • make
  • make install (as root, e.g. sudo make install)

The resulting executable is named qalculate-qt.

Features (from libqalculate)

  • Calculation and parsing:
    • Basic operations and operators: + - * / mod ^ E () && || ! < > >= <= != ~ & | << >> xor
    • Fault-tolerant parsing of strings: log 5 / 2 .5 (3) + (2( 3 +5 = ln(5) / (2.5 * 3) + 2 * (3 + 5)
    • Expressions may contain any combination of numbers, functions, units, variables, vectors and matrices, and dates
    • Supports complex and infinite numbers
    • Propagation of uncertainty
    • Interval arithmetic (for determination of the number of significant digits or direct calculation with intervals of numbers)
    • Supports all common number bases, as well as negative and non-integer radices, sexagesimal numbers, time format, and roman numerals
    • Ability to disable functions, variables, units or unknown variables for less confusion: e.g. when you do not want (a+b)^2 to mean (are+barn)^2 but ("a"+"b")^2
    • Controllable implicit multiplication
    • Matrices and vectors, and related operations (determinants etc.)
    • Verbose error messages
    • Arbitrary precision
    • RPN mode
  • Result display:
    • Supports all common number bases, as well as negative and non-integer radices, sexagesimal numbers, time format, and roman numerals
    • Many customization options: precision, max/min decimals, complex form, multiplication sign, etc.
    • Exact or approximate: sqrt(32) returns 4 * sqrt(2) or 5.66
    • Simple and mixed fractions: 4 / 6 * 2 = 1.333... = 4/3 = 1 + 1/3
  • Symbolic calculation:
    • E.g. (x + y)^2 = x^2 + 2xy + y^2; 4 "apples" + 3 "oranges"
    • Factorization and simplification
    • Differentiation and integration
    • Can solve most equations and inequalities
    • Customizable assumptions give different results (e.g. ln(2x) = ln(2) + ln(x) if x is assumed positive)
  • Functions:
    • Hundreds of flexible functions: trigonometry, exponents and logarithms, combinatorics, geometry, calculus, statistics, finance, time and date, etc.
    • Can easily be created, edited and saved to a standard XML file
  • Units:
    • Supports all SI units and prefixes (including binary), as well as imperial and other unit systems
    • Automatic conversion: ft + yd + m = 2.2192 m
    • Explicit conversion: 5 m/s to mi/h = 11.18 miles/hour
    • Smart conversion: automatically converts 5 kg*m/s^2 to 5 N
    • Currency conversion with retrieval of daily exchange rates
    • Different name forms: abbreviation, singular, plural (m, meter, meters)
    • Can easily be created, edited and saved to a standard XML file
  • Variables and constants:
    • Basic constants: pi, e, etc.
    • Lots of physical constants (with or without units) and properties of chemical element
    • CSV file import and export
    • Can easily be created, edited and saved to a standard XML file
    • Flexible - may contain simple numbers, units, or whole expressions
    • Data sets with objects and associated properties in database-like structure
  • Plotting:
    • Uses Gnuplot
    • Can plot functions or data (matrices and vectors)
    • Ability to save plot to PNG image, postscript, etc.
    • Several customization options
  • and more...

For more details about the syntax, and available functions, units, and variables, please consult the manual (https://qalculate.github.io/manual/)

Examples (expressions)

Note that semicolon can be replaced with comma in function arguments, if comma is not used as decimal or thousands separator.

Basic functions and operators

sqrt 4 = sqrt(4) = 4^(0.5) = 4^(1/2) = 2

sqrt(25; 16; 9; 4) = [5 4 3 2]

sqrt(32) = 4 ร— โˆš(2) (in exact mode)

cbrt(โˆ’27) = root(-27; 3) = โˆ’3 (real root)

(โˆ’27)^(1/3) โ‰ˆ 1.5 + 2.5980762i (principal root)

ln 25 = log(25; e) โ‰ˆ 3.2188758

log2(4)/log10(100) = log(4; 2)/log(100; 10) = 1

5! = 1 ร— 2 ร— 3 ร— 4 ร— 5 = 120

5\2 = 5//2 = trunc(5 / 2) = 2 (integer division)

5 mod 3 = mod(5; 3) = 2

52 to factors = 2^2 ร— 13

25/4 ร— 3/5 to fraction = 3 + 3/4

gcd(63; 27) = 9

sin(pi/2) โˆ’ cos(pi) = sin(90 deg) โˆ’ cos(180 deg) = 2

sum(x; 1; 5) = 1 + 2 + 3 + 4 + 5 = 15

sum(\i^2+sin(\i); 1; 5; \i) = 1^2 + sin(1) + 2^2 + sin(2) + ... โ‰ˆ 55.176162

product(x; 1; 5) = 1 ร— 2 ร— 3 ร— 4 ร— 5 = 120

var1:=5 (stores value 5 in variable var1) var1 ร— 2 = 10

5^2 #this is a comment = 25

sinh(0.5) where sinh()=cosh() = cosh(0.5) โ‰ˆ 1.1276260

plot(x^2; โˆ’5; 5) (plots the function y=x^2 from -5 to 5)

Units

5 dm3 to L = 25 dm^3 to L = 5 L

20 miles / 2h to km/h = 16.09344 km/h

1.74 to ft = 1.74 m to ft โ‰ˆ 5 ft + 8.5039370 in

1.74 m to -ft โ‰ˆ 5.7086614 ft

100 lbf ร— 60 mph to hp โ‰ˆ 16 hp

50 ฮฉ ร— 2 A = 100 V

50 ฮฉ ร— 2 A to base = 100 kgยทmยฒ/(sยณยทA)

10 N / 5 Pa = (10 N)/(5 Pa) = 2 mยฒ

5 m/s to s/m = 0.2 s/m

500 โ‚ฌ โˆ’ 20% to $ โ‰ˆ $451.04

500 megabit/s ร— 2 h to b?byte โ‰ˆ 419.09516 gibibytes

Physical constants

k_e / G ร— a_0 = (coulombs_constant / newtonian_constant) ร— bohr_radius โ‰ˆ 7.126e9 kgยทHยทm^โˆ’1

โ„Ž / (ฮป_C ร— c) = planck โˆ• (compton_wavelength ร— speed_of_light) โ‰ˆ 9.1093837e-31 kg

5 ns ร— rydberg to c โ‰ˆ 6.0793194E-8c

atom(Hg; weight) + atom(C; weight) ร— 4 to g โ‰ˆ 4.129e-22 g

(G ร— planet(earth; mass) ร— planet(mars; mass))/(54.6e6 km)^2 โ‰ˆ 8.58e16 N (gravitational attraction between earth and mars)

Uncertainty and interval arithmetic

"ยฑ" can be replaced with "+/-"; result with interval arithmetic activated is shown in parenthesis

sin(5ยฑ0.2)^2/2ยฑ0.3 โ‰ˆ 0.460ยฑ0.088 (0.46ยฑ0.12)

(2ยฑ0.02 J)/(523ยฑ5 W) โ‰ˆ 3.824ยฑ0.053 ms (3.825ยฑ0.075 ms)

interval(โˆ’2; 5)^2 โ‰ˆ intervall(โˆ’8.2500000; 12.750000) (intervall(0; 25))

Algebra

(5x^2 + 2)/(x โˆ’ 3) = 5x + 15 + 47/(x โˆ’ 3)

(\a + \b)(\a โˆ’ \b) = ("a" + "b")("a" โˆ’ "b") = 'a'^2 โˆ’ 'b'^2

(x + 2)(x โˆ’ 3)^3 = x^4 โˆ’ 7x^3 + 9x^2 + 27x โˆ’ 54

factorize x^4 โˆ’ 7x^3 + 9x^2 + 27x โˆ’ 54 = x^4 โˆ’ 7x^3 + 9x^2 + 27x โˆ’ 54 to factors = (x + 2)(x โˆ’ 3)^3

cos(x)+3y^2 where x=pi and y=2 = 11

gcd(25x; 5x^2) = 5x

1/(x^2+2xโˆ’3) to partial fraction = 1/(4x โˆ’ 4) โˆ’ 1/(4x + 12)

x+x^2+4 = 16 = (x = 3 or x = โˆ’4)

x^2/(5 m) โˆ’ hypot(x; 4 m) = 2 m where x > 0 = (x โ‰ˆ 7.1340411 m)

cylinder(20cm; x) = 20L (calculates the height of a 20 L cylinder with radius of 20 cm) = (x = (1 / (2ฯ€)) m) = (x โ‰ˆ 16 cm)

asin(sqrt(x)) = 0.2 = (x = sin(0.2)^2) = (x โ‰ˆ 0.039469503)

x^2 > 25x = (x > 25 or x < 0)

solve(x = y+ln(y); y) = lambertw(e^x)

solve2(5x=2y^2; sqrt(y)=2; x; y) = 32/5

multisolve([5x=2y+32, y=2z, z=2x]; [x, y, z]) = [โˆ’32/3 โˆ’128/3 โˆ’64/3]

dsolve(diff(y; x) โˆ’ 2y = 4x; 5) = 6e^(2x) โˆ’ 2x โˆ’ 1

Calculus

diff(6x^2) = 12x

diff(sinh(x^2)/(5x) + 3xy/sqrt(x)) = (2/5) ร— cosh(x^2) โˆ’ sinh(x^2)/(5x^2) + (3y)/(2 ร— โˆš(x))

integrate(6x^2) = 2x^3 + C

integrate(6x^2; 1; 5) = 248

integrate(sinh(x^2)/(5x) + 3xy/sqrt(x)) = 2x ร— โˆš(x) ร— y + Shi(x^2) / 10 + C

integrate(sinh(x^2)/(5x) + 3xy/sqrt(x); 1; 2) โ‰ˆ 3.6568542y + 0.87600760

limit(ln(1 + 4x)/(3^x โˆ’ 1); 0) = 4 / ln(3)

Matrices and vectors

[1, 2, 3; 4, 5, 6] = ((1; 2; 3); (4; 5; 6)) = [1 2 3; 4 5 6] (2ร—3 matrix)

(1; 2; 3) ร— 2 โˆ’ 2 = [(1 ร— 2 โˆ’ 2), (2 ร— 2 โˆ’ 2), (3 ร— 2 โˆ’ 2)] = [0 2 4]

[1 2 3].[4 5 6] = dot([1 2 3]; [4 5 6]) = 32 (dot product)

cross([1 2 3]; [4 5 6]) = [โˆ’3 6 โˆ’3] (cross product)

[1 2 3; 4 5 6].ร—[7 8 9; 10 11 12] = hadamard([1 2 3; 4 5 6]; [7 8 9; 10 11 12]) = [7 16 27; 40 55 72] (hadamard product)

[1 2 3; 4 5 6] ร— [7 8; 9 10; 11 12] = [58 64; 139 154] (matrix multiplication)

[1 2; 3 4]^-1 = inverse([1 2; 3 4]) = [โˆ’2 1; 1.5 โˆ’0.5]

Statistics

mean(5; 6; 4; 2; 3; 7) = 4.5

stdev(5; 6; 4; 2; 3; 7) โ‰ˆ 1.87

quartile([5 6 4 2 3 7]; 1) = percentile((5; 6; 4; 2; 3; 7); 25) โ‰ˆ 2.9166667

normdist(7; 5) โ‰ˆ 0.053990967

spearman(column(load(test.csv); 1); column(load(test.csv); 2)) โ‰ˆ โˆ’0.33737388 (depends on the data in the CSV file)

Time and date

10:31 + 8:30 to time = 19:01

10h 31min + 8h 30min to time = 19:01

now to utc = "2020-07-10T07:50:40Z"

"2020-07-10T07:50CET" to utc+8 = "2020-07-10T14:50:00+08:00"

"2020-05-20" + 523d = addDays(2020-05-20; 523) = "2021-10-25"

today โˆ’ 5 days = "2020-07-05"

"2020-10-05" โˆ’ today = days(today; 2020-10-05) = 87 d

timestamp(2020-05-20) = 1 589 925 600

stamptodate(1 589 925 600) = "2020-05-20T00:00:00"

"2020-05-20" to calendars (returns date in Hebrew, Islamic, Persian, Indian, Chinese, Julian, Coptic, and Ethiopian calendars)

Number bases

52 to bin = 0011 0100

52 to bin16 = 0000 0000 0011 0100

52 to oct = 064

52 to hex = 0x34

0x34 = hex(34) = base(34; 16) = 52

523<<2&250 to bin = 0010 1000

52.345 to float โ‰ˆ 0100 0010 0101 0001 0110 0001 0100 1000

float(01000010010100010110000101001000) = 1715241/32768 โ‰ˆ 52.345001

floatError(52.345) โ‰ˆ 1.2207031e-6

52.34 to sexa = 52ยฐ20โ€ฒ24โ€ณ

1978 to roman = MCMLXXVIII

52 to base 32 = 1K

sqrt(32) to base sqrt(2) โ‰ˆ 100000

0xD8 to unicode = ร˜

code(ร˜) to hex = 0xD8