Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [calculator]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-2 votes
3 answers
95 views

How to make bc handle explicitly positive numbers?

Consider the following: $ echo "-1" | bc -1 $ echo "(1)" | bc 1 $ echo "+1" | bc (standard_in) 1: syntax error Minus sign and round braces are handled correctly but ...
Anton Samokat's user avatar
-1 votes
1 answer
70 views

SpeedCrunch is Providing Slow Math Calculations

I'm having a performance issue with SpeedCrunch 0.12 in Debian 12: sudo apt install speedcrunch First of all, I love the UI of SpeedCrunch, as a calculator, but currently (for me) it is giving very ...
Lonnie Best's user avatar
  • 5,155
0 votes
0 answers
51 views

After cpu time hits 8128 seconds my calculations stops

I'm new to Linux and for my bachelor thesis I'm using it in order to calculate properties of materials in physics, therefore heavy calculations are involved. I've noticed that whenever Cpu time hits ...
CoolerThanACooler's user avatar
0 votes
1 answer
65 views

Bash script to calculate within a CSV with or without zero

I have a script here that I am working with. I would now like to expand this. POSIXLY_CORRECT=1 awk -F ';' -v OFS=';' ' {print $0, NR == 1 ? "Price" : $1 ? $1 : $3 * 1.2}' < file.csv ...
dima1002's user avatar
1 vote
1 answer
286 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 ...
Kaligule's user avatar
  • 113
-1 votes
1 answer
415 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
0 votes
1 answer
107 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 ...
Logan Tischler's user avatar
0 votes
0 answers
40 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 ...
sdaau's user avatar
  • 6,798
2 votes
2 answers
470 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 ...
SSR's user avatar
  • 25
-1 votes
1 answer
695 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 ...
jonny b's user avatar
  • 83
1 vote
1 answer
570 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?
Jim-chriss Charles's user avatar
68 votes
21 answers
102k 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:...
Fabby's user avatar
  • 5,394
2 votes
1 answer
62 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 ...
Christian Neumann's user avatar
2 votes
1 answer
158 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.
Cedric Martens's user avatar
5 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.
shirish's user avatar
  • 12.5k
5 votes
1 answer
2k 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?
K Split X's user avatar
  • 1,733
1 vote
2 answers
239 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....
infoclogged's user avatar
0 votes
0 answers
683 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 ...
shirish's user avatar
  • 12.5k
0 votes
2 answers
209 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 ...
iLikeDirt's 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 ...
kenorb's user avatar
  • 21.1k
19 votes
4 answers
31k views

How to calculate hexadecimal xor (^) from shell?

Unfortunately bc and calc don't support xor.
Costa's user avatar
  • 552
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)?
PetaspeedBeaver's 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 ...
rootkea's user avatar
  • 186
1 vote
2 answers
184 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 ...
scolfax's user avatar
  • 121
4 votes
5 answers
7k 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=...
Aliakbar Ahmadi's user avatar
2 votes
1 answer
1k 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
57 votes
4 answers
33k views

How is bc different from dc?

What are the differences between dc and bc calculators? When should I use dc and when bc?
syntagma's user avatar
  • 12.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 ...
erik's user avatar
  • 17.4k
4 votes
1 answer
915 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.
daisy's user avatar
  • 54.7k
0 votes
1 answer
125 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 ...
FCTW's user avatar
  • 133
14 votes
3 answers
19k 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 ...
Petr Skocik's user avatar
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, ...
kyle k's user avatar
  • 442
16 votes
4 answers
92k 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....
apasajja's user avatar
  • 1,917
28 votes
1 answer
32k 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?
daisy's user avatar
  • 54.7k
23 votes
6 answers
17k 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.
daisy's user avatar
  • 54.7k
420 votes
17 answers
643k 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 ...
Michael Durrant's user avatar
3 votes
1 answer
375 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 ...
student's user avatar
  • 18.4k