Questions tagged [calculator]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
69 views

evaluate terms in zsh without a command

I am using zsh with the prezto configuration framework. I want to be able to type in terms like 1 + 2 * (3 / 4) and get "2.5" out of it. Those terms could be recognized because they only ...
user avatar
  • 113
0 votes
1 answer
122 views

How to round to the correct nearest number in Linux bc?

How do we round to the correct nearest number in a Linux basic calculator BC?
user avatar
-1 votes
1 answer
78 views

Linux BC calculator multiple variables must be read or seen by Bash [closed]

How can linux BC calculator multiple variables, not just one obtain by command substitution, be recognized or seen by Bash
user avatar
0 votes
0 answers
22 views

Linux calculator - move result between engineering notations n x 10^-3 to say 0.00n x 10^-6

Is there a way to move between engineering notations for the result of a calculation? in any of the linux calculators, qalcalculate, gnome calculator, other? So for instance: If want the results of a ...
user avatar
0 votes
0 answers
49 views

Debian on TI-Nspire

I am following this tutorial: https://ivoah.net/blog/2016/03/20/how-to-install-debian-on-a-ti-nspire/ (I have all of the required items.) I am using an Acer Chromebook C720, which I dual-booted Debian ...
user avatar
0 votes
0 answers
30 views

Why does wcalc output rounding symbol (~=) for integer operations (subtraction)?

I have noted, that man wcalc says: --ints Toggles whether long integers will be abbreviated or not. This conflicts with engineering notation for large numbers, but ...
user avatar
  • 6,296
2 votes
2 answers
270 views

Calculations in shell Unix

I'm trying to work out the difference in 2 unix times to do a simple calculation (in a shell script) but it doesn't seem to work. I have set 2 variables one called $d and the other $c. Here's the ...
user avatar
  • 25
-1 votes
1 answer
379 views

How can i check if a number is higher or lower then another number?

I have files that contain 2 numbers like the following: File 1 1 0 File 2 0 1 File 3 3 3 I want to compare the number on the first line to the number on the second line. If the number on the ...
user avatar
  • 73
1 vote
1 answer
369 views

Gnome's calculator: "Malformed expression"

I can't calculate a simple math expression 1.3e4 * 10 in the Gnome's calculator in scientific mode, I just get "Malformed expression" warning below the number pane. What am I supposed to do?
user avatar
54 votes
21 answers
69k views

Simple command-line calculator

Issue: Every now and then I need to do simple arithmetic in a command-line environment. E.G. given the following output: Disk /dev/sdb: 256GB Sector size (logical/physical): 512B/512B Partition Table:...
user avatar
  • 5,622
2 votes
0 answers
36 views

Financial calculations without floating point numbers in console?

I need to do simple financial calculations on Linux and had been using wcalc for this until I stumbled upon a wrong result caused by floating-point number issues. Is there a calculator (I really would ...
user avatar
2 votes
1 answer
124 views

How to call a function from wcalc?

wcalc has built in constants in functions. I'm trying to call the abs function. If I input wcalc abs(-2) I get syntax error = -2 Unless I enter interactive mode where it works.
user avatar
3 votes
4 answers
3k views

currency conversion calculator in debian

sometime back I saw a calculator with currency conversion built-in with an option to update to current rates if so desired. Does anybody know what I'm talking about ? Saw it in debian.
user avatar
  • 11k
3 votes
1 answer
1k views

How do I clear gnome-calculator history?

How do I clear gnome calculator history? Like in terminal, we can press Ctrl L to clear, but what about calculator? I also don't see a clear button?
user avatar
  • 1,373
1 vote
2 answers
198 views

Mathpad alternative

I was looking for some kind of a plotter, graphic calculator to produce images, such as eclipse, parabola, logarithm etc. I saw one on wikipedia https://en.wikipedia.org/wiki/File:Lemniscate_of_Booth....
user avatar
0 votes
0 answers
594 views

Looking for a GUI calculator which has support for two zeroes and history

Most of the calculators, for e.g. mate-calc and galculator are good enough for simple needs. There are two functions which I need and want to use in the calculator - It should have support for two ...
user avatar
  • 11k
0 votes
2 answers
183 views

Can you get something like Unity Dash--especially the instant calculator--in other distros?

In Ubuntu, Unity Dash is a lot like the Mac Spotlight: a search interface, app launcher, and, with the calculator lens (https://apps.ubuntu.com/cat/applications/unity-scope-calculator/), an instant ...
user avatar
  • 123
0 votes
1 answer
2k views

Unix command to return maximum float value out of two after subtraction

This is similar to question about getting the minimum/maximum of two numbers, but I'm interested to do the same with float numbers. So basically I'm trying to use shell arithmetic expansion using the ...
user avatar
  • 18.6k
19 votes
4 answers
28k views

How to calculate hexadecimal xor (^) from shell?

Unfortunately bc and calc don't support xor.
user avatar
  • 542
2 votes
2 answers
1k views

How to use the result from last calculation in a new calculation in wcalc?

In wcalc how can I do something like -> 1+2 = 3 -> X+1 = 4 where X equals the result of the last calculation (that is 3)?
user avatar
6 votes
3 answers
1k views

dc unix : preserving initial value even after storing new value at the same array index

I'm unable to understand this example given in manpage of dc: $ dc 1 0:a 0Sa 2 0:a La 0;ap 1 To me answer should be 2 because: 1 0:a Here we store 1 at 0th position of array a. 0Sa Now ...
user avatar
  • 186
1 vote
2 answers
141 views

Any way to customize the initialization of variables in the bc calculator?

The bc calculator appears to assign uninitialized variables the value of zero. I would like to alter this behavior so that when bc encounters an uninitialized variable, it instead flags the expression ...
user avatar
  • 121
2 votes
5 answers
6k views

bc scale: How to avoid rounding? (Calculate small binomial probability)

Following code calculates the Binomial Probability of a success event k out of n trials: n=144 prob=$(echo "0.0139" | bc) echo -e "Enter no.:" read passedno k=$passedno nCk2() { num=1 den=...
user avatar
2 votes
1 answer
958 views

calendar to check the date and then search 3 months back and add up the days of those months

I want to use the cal command or the date command to display the current day, then I want it to display 3 months before the current date, then add up all the days in those 3 months up to the current ...
user avatar
49 votes
4 answers
29k views

How is bc different from dc?

What are the differences between dc and bc calculators? When should I use dc and when bc?
user avatar
  • 11.4k
6 votes
2 answers
2k views

how to add command line calculator to bash that uses comma as decimal mark?

How can I add a command line calculator to my bash? I have found some, but all of them use the full stop as decimal mark, but I want to have it to use the comma as decimal mark as most of the world ...
user avatar
  • 16.1k
4 votes
1 answer
699 views

Perform calculation in hex with Qalculate

I'm trying to do hex calculations, C - A, and I already changed number base to hex, but Qalculate still doesn't work.
user avatar
  • 51.2k
0 votes
1 answer
116 views

Where are the variables stored for mate-calc?

I know that there's no way to delete them by default in the application, but they have to be stored somewhere? I'm pretty handy with the command line, so I can do some such there. I believe that ...
user avatar
  • 133
13 votes
3 answers
17k views

BC—automatic full precision multiplication [duplicate]

High, I need to test my arbitrary precision calculator, and bc seems like a nice yardstick to compare to, however, bc does truncate the result of each multiplication to what seems to be the maximum ...
user avatar
  • 26.5k
4 votes
1 answer
5k views

Installing Linux on the TI-nspire

I am having trouble installing Linux on my TI-nspire cx cas graphing calculator. I downloaded the files and the Linux image. I have read several websites on the topic but it was not that much help, ...
user avatar
  • 432
14 votes
4 answers
84k views

Calculate variable, and output it to another variable

The only calculator I know is bc. I want to add 1 to a variable, and output to another variable. I got the nextnum variable from counting string in a file: nextnum=`grep -o stringtocount file.tpl....
user avatar
  • 1,857
27 votes
1 answer
29k views

Does bc support hex calculations?

I'm trying to do a hex calculation directly with bc, I already specified the scale. echo 'scale=16;c06b1000-c06a5e78' | bc But I still get a zero. What could be wrong?
user avatar
  • 51.2k
20 votes
6 answers
15k views

bc doesn't support log and factorial calculation?

Is there any other command line calculator that supports log, n! calculations? At least bc can't do that, it produced a parse error. It's best if I could use it in a script, e.g echo '5!' | program.
user avatar
  • 51.2k
393 votes
17 answers
559k views

How to do integer & float calculations, in bash or other languages/frameworks?

Using echo "20+5" literally produces the text "20+5". What command can I use to get the numeric sum, 25 in this case? Also, what's the easiest way to do it just using bash for floating point? For ...
user avatar
3 votes
1 answer
361 views

Make screenshots of Ti-calculator screen

I want to connect a TI-84 Plus Calculator to my PC and take screenshots of the calculator display. Under windows this is possible using the TI-connect software. However is there also a way to do this ...
user avatar
  • 16.9k