Questions tagged [calculation]

Mathematical operation or series of operations which takes some input and gives an output.

A calculation is at the simplest level the execution of some mathematical equation. Based upon the composition of this equation, including variables, operators or more complex functions implementing user-defined logic, a particular calculation can be very crucial to the correct operation of an overall system.

In software there are many different mathematical operators which may make up an equation a calculation executes:

  • Addition (+)
  • Subtraction (-)
  • Multiplication (x)
  • Division (/)
  • Bitwise AND (&)
  • Bitwise OR (|)
  • Bitwise XOR (^)
  • Bitwise NOR (~)
  • Bitwise LSHIFT (<<)
  • Bitwise RSHIFT (>>)
1579 questions
3
votes
3 answers

PHP find the days until a date

I have to find the number of days until a date in timestamp format (mysql db) $row['date_exp'] format is '2013-12-16 10:00:00'; $datenow = date("Y-m-d"); $diff = (strtotime($row['date_exp']) - strtotime($datenow))/(86400); $days = sprintf("%02d",…
Paolo Rossi
  • 2,490
  • 9
  • 43
  • 70
2
votes
2 answers

Is it possible to Calculate with Operands in Order out of two Arrays Merged to one?

I try to build a calculator with user input and want to calculate everything with Operands in Order. I saved the user input in two String ArrayLists: -> postNumbers for all numbers -> postOperands for all operands I tried to calculate them with…
2
votes
2 answers

Python: calculate with dataframe and dictionary?

I have a dataframe/excel sheet with transaction types of business processes and how often a transaction type was performed: branch Transaction…
hugo999
  • 33
  • 3
2
votes
1 answer

Optimising for Programming Challenge (KATTIS)

Working on this problem: Ab Initio I have been tweaking and timing the various parts of my code (as it is too slow) and I cannot get a decent speed for the final calculation of hi hi, the hash of the adjacency list of vertex i, defined as follows.…
ChlsM1986
  • 21
  • 2
2
votes
0 answers

Calculation from the merged cells

From the table below, I wanted to calculate the average percentage of training. If the status starts with "3" show as 100, "2" show as 50, and "3" show as 0 and then calculate the average. The summary table doesn't include the subjects which are…
Cath
  • 125
  • 10
2
votes
2 answers

Where to reset the value of operator in calculator?

This is a live demo of my calculator: https://kepplin.github.io/odin-calculator/ After the equals button is pressed and the calculation is displayed, if a number button is pressed, then instead of starting a new calculation, the calculator evaluates…
2
votes
1 answer

How to calculate the remaining size of the widget from flutter?

I created a flutter widget in order Container ~> Columns [ Containers Expanded ~> Stack ~> MaterialApp ~> Scaffold , Container( ], I tried with the media query size height but got the result screen height throughout the app, how do i get the rest of…
2
votes
1 answer

pandas perform division between 2 tables (1 aggregated) with different size

I am a newbie to pandas and I am struggling to get the result that I want after doing research / experiencing some trial and errors...appreciate any guidance from here, thanks in advance! Supposed I have a dataframe which holds some trade data, to…
2
votes
2 answers

How to make sure the height doesn't exceed the parent's height while also maintaining image's aspect ratio

I have an image which width should be as large as possible and I want it's height to not exceed the height of the parent while also maintaining the aspect ratio of 16:9. The issue right now is, it works well till the screen size is 1591px, if it…
Nyi Nyi Hmue Aung
  • 587
  • 1
  • 7
  • 19
2
votes
2 answers

Excel value calculation based on column name

I have a table with column names as postal code and under every postal code there is revenue, but there are some postal s that have letters in them or are empty and that causes my formula to return error. Idea is to calculate revenue for each…
Stuxnet
  • 103
  • 8
2
votes
1 answer

Fill missing Variables by Information from other date columns (R)

I have a Dataframe which looks similar to this: set.seed(42) start <- Sys.Date() + sort(sample(1:10, 5)) set.seed(43) end <- Sys.Date() + sort(sample(1:10, 5)) end[4] <- NA A <- c("10", "15", "NA", "4", "NA") B <- rpois(n = 5, lambda = 10) df…
Sulz
  • 333
  • 1
  • 8
2
votes
1 answer

Calculation divergence in Python

I did this calculation in Python: ((1.00044*(1.00175/1.00044)**(252/(4-1))**((1-1)/252))**(252/1)-1)*100 55.36617662154271 The same calculation in Excel presents this result: 11,7234. What is the reason for this divergence?
Deivid
  • 53
  • 4
2
votes
2 answers

How to implement Log base 2 in flutter?

How can I find Log2(x) in flutter? I didn't found the match function in flutter math package Note: Log base 2
2
votes
2 answers

How to subtract X hours to a time field

I would like to output in a div the result of a math calculation (subtract). In the specific I have a form with a that let user pick up a time. I would like to display in another div the result of the chosen…
Enya
  • 33
  • 3
2
votes
0 answers

Calculate/replicate RSI from Tradingview's pine script

Im trying to recreate Tradingviews pine script RSI code into Javascript code. But having a hard time figuring out how it works. I made the basic RSI using a normal moving average calculation. But the pine script uses exponential weighted moving…
Allart
  • 830
  • 11
  • 33