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
16
votes
2 answers

R subtracting 1 month from today's date gives NA

I have a script in which I subset my data according to some set time periods and wanted to subset all the records that had occurred in the last month. However if I try to subtract one month from today's date it yields an NA: > today <- Sys.Date() >…
Amy M
  • 967
  • 1
  • 9
  • 19
13
votes
1 answer

Calculating size of Google Firestore documents

Firestore docs give details of how to manually calculate the stored size of a document, but there does not seem to be a function provided for this on any of document reference, snapshot, or metadata. Before I attempt to use my own calculation, does…
pwray
  • 1,075
  • 1
  • 10
  • 19
11
votes
3 answers

Difference between PromQL "by" and "without" unclear

I have a question about calculating response times with Prometheus summary metrics. I created a summary metric that does not only contain the service name but also the complete path and the http-method. Now I try to calculate the average response…
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
7
votes
6 answers

Get the biggest chronological drop, min and max from an array with O(n)

I have written a javascript function for analyzing the biggest drop in an array. But one little issue is still there. As the max value, I always get max value from my hole array and not from my drop. Example: Array: [100,90,80,120] The biggest drop…
Pommesloch
  • 492
  • 5
  • 17
7
votes
2 answers

css element height minus height of a element with changing height

aye folks! is it possible to have dynamic height calculation with css3? i couldn't find anything.. but maybe i'm just using the wrong terms for my search. the problem: i have a site where i want to include an iframe with 100% height minus the height…
Andreas Grafen
  • 105
  • 1
  • 2
  • 9
6
votes
2 answers

Manipulating data in DataFrame: how to calculate the square of a column

I would like to calculate the square of a column A 1,2,3,4, process it with other calculation store it in column C using CSV, DataFrames df = DataFrame(A = 1:4, B = ["M", "F", "F", "M"]) df.C = ((((df.A./2).^2).*3.14)./1000) Is there an easier way…
ecjb
  • 5,169
  • 12
  • 43
  • 79
6
votes
1 answer

Mongodb calculation query--cummulative multiplication

I recently started working in Mongodb for POC. I have one json collection below db.ccpsample.insertMany([ { "ccp_id":1, "period":601, "sales":100.00 }, { "ccp_id":1, "period":602, "growth":2.0, "sales":"NULL" …
Tharunkumar Reddy
  • 2,773
  • 18
  • 32
6
votes
1 answer

How do I set application calculation back as to defined by user in Excel VBA?

I have a rather large workbook, and some users prefer to have automatic calculation on, while others prefer having it off. Some macros that interact with the sheets are attatched to the workbook. To speed up my VBA code, I…
johs32
  • 63
  • 1
  • 4
5
votes
1 answer

VBA code not working correctly in some scenario's

Good day, was hoping someone could help with the following. this is the criteria: Monday to Friday:06:00 to 7:30 (2 points per hour) 14:00 to 17:00 (1 point per hour) 17:00 to 19:00 (2 points per hour) 19:00-01:00 (3 points per hour) Saturday…
5
votes
1 answer

Google Sheets change background color based on value of another cell

In Google Sheets, is there a way to change not just the value but also the background color of a cell based on one of several possible values of another cell?? In other words, If A1 is > 2, then B1 should be background color blue I would like to…
Mel
  • 89
  • 1
  • 1
  • 4
4
votes
1 answer

Pandas calculates absolute values recursively

I've a dataframe (called data in this post) with positive and negative values in a column. I do the following: data.Col.min() --> results in a negative value data_abs = data data_abs['Col'] = data_abs['Col'].abs() data.Col.min() --> results to the…
4
votes
1 answer

Getting the max of three calculations in pandas

I tried looking for an answer but couldn't find it. If someone has a link, all the better. My question goes as follows. I have a sheet I am reading in pandas which has numerous columns with values in it. There are three calculations I need to run…
Ian Lang
  • 45
  • 4
4
votes
1 answer

Why does a calculation error occur when this double value is multiplied by 2 in C++?

#include #include #include #include #include #include using namespace std; int main() { uint64_t int_value = 0b0000000000001101000011110100001011000000110111111010111101110011; …
W.Z.Hai
  • 105
  • 6
4
votes
3 answers

Calculating very large power

I want to calculate for very large numbers like n = 10^15. Somehow I can't, because of OverflowError. xd = lambda n : ((((5+ sqrt(17)) * ((3 + sqrt(17)) ** n)) - ((5-sqrt(17))* ((3 - sqrt(17)) ** n)))/((2 ** (n+1)) * sqrt(17))) even for n=1000, it…
4
votes
1 answer

How to calculate a monthly car payment for a form I'm creating in JavaScript

I am trying to put this JavaScript in Adobe as a calculation field. The point of this is to use Term, Amount Financed and APR (Interest Rate) to calculate a monthly car payment for a form I'm creating. All I want to know is what JavaScript code will…
ASP tech
  • 67
  • 6
1
2 3
99 100