Questions tagged [calculator]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
15 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 ...
2
votes
2answers
219 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 ...
0
votes
0answers
33 views

error in simple calculator [duplicate]

Enter n1 2 Enter n2 3 ./Calculato.sh: line 12: while[yes=yes]: command not found ./Calculato.sh: line 13: syntax error near unexpected token `do' ./Calculato.sh: line 13: `do' Program: ...
-1
votes
1answer
65 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 ...
1
vote
1answer
169 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?
34
votes
18answers
27k 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:...
2
votes
0answers
32 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 ...
2
votes
1answer
99 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.
3
votes
4answers
1k 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.
1
vote
1answer
716 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?
1
vote
2answers
145 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....
0
votes
0answers
526 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 ...
0
votes
2answers
166 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 ...
0
votes
1answer
962 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 ...
16
votes
4answers
19k views

How to calculate hexadecimal xor (^) from shell?

Unfortunately bc and calc don't support xor.
2
votes
2answers
804 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)?
5
votes
3answers
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 ...
1
vote
2answers
98 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 ...
1
vote
5answers
3k 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=...
2
votes
1answer
436 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 ...
35
votes
4answers
25k views

How is bc different from dc?

What are the differences between dc and bc calculators? When should I use dc and when bc?
6
votes
2answers
1k 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 ...
4
votes
1answer
567 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.
0
votes
1answer
114 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 ...
10
votes
3answers
13k views

BC—automatic full precision multiplication

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 ...
4
votes
1answer
4k 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, ...
11
votes
4answers
68k 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....
21
votes
1answer
25k 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?
18
votes
6answers
12k 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 told me parse error It's best if I could use script, e.g echo '5!' | program
326
votes
17answers
418k 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 ...
3
votes
1answer
344 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 ...