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
2
votes
1 answer

How to divide values from the same dimension in Tableau?

I am trying to divide values from the same pill in Tableau. Per my screenshot, the pill is named "Animals" & the grouped values within that pill are dog, cat, hamster & horse. How can I divide dog by cat? How can I divide hamster by horse? How I…
J A
  • 45
  • 8
2
votes
1 answer

Automate Spreadsheet Calculation

I'm trying to build out a spreadsheet formula that will allow me to take one list of numbers and evenly distribute them into another list of numbers. Attaching an example below. I'm sure there's a way to automate this process but I've done extensive…
gbmytabc
  • 21
  • 4
2
votes
4 answers

calculate the content of a variable

I'm learning python, and I have encountered a problem. for i in input: operator = i.split()[0] number1 = i.split()[1] number2 = i.split()[2] equation = (number1 + ' ' + operator + ' ' + number2) This code is supposed to calculate a…
NilT_PL
  • 21
  • 1
2
votes
1 answer

Matlab: Storing user input into arrays for calculating repeatedly

I'm writing a MATLAB program for solving the positive z and negative z traveling waves in a multiple region problem. The user chooses the number of layers to be N, and assume the characteristic parameters to be ei ; , µi , and oi in the ith region.…
GaNk1n1t
  • 23
  • 3
2
votes
2 answers

Modify values of date/time text string in HTML with JS/jQuery

I’d like to convert part of a date/time text string to a number, perform addition/subtraction on it, taking into account the am/pm switch-over at 12:00, and run it behind the original. Possible? For example, in the existing HTML,
Molesworth
  • 21
  • 2
2
votes
1 answer

Dividing numpy array by numpy scalar

I'm trying to divide numpy array by numpy float64 type scalar. Following is my code. pose_q = np.array(pose_q) expectecd_q = np.array(expectecd_q) pose_q = np.squeeze(pose_q) expectecd_q = np.squeeze(expectecd_q) q1 = expectecd_q /…
Mr. Randy Tom
  • 311
  • 5
  • 13
2
votes
1 answer

How to get cart subtotal inside WC_Shipping_Method calculate_shipping() method

So I was trying to create a woocommerce shipping method that takes the cart subtotal and charges a user-defined percentage of the cart subtotal as a shipping fee. As a first step towards this goal, ehat I did was basically like this class…
2
votes
3 answers

Pandas dataframe calculation based on condition

I have two dataframe and i need to use 1 as a reference to calculate the other values. For example, I have df like this: Brand LB_ID Score BMW Class 98 BMW Cost 99 VW Class 85 VW Cost 70 And…
s_khan92
  • 969
  • 8
  • 21
2
votes
1 answer

Maxima. How to prevent degree calculations

Is it possible for all calculations in the expression for numbers in a power to be prevented? Perhaps by pre-processing the expression or adding tellsimp rules? Or some other way? For example, to distrib (10 ^ 10 * (x + 1)); which…
2
votes
4 answers

Convert decimal time to hours and minutes in Swift

I am new to programming and this is my first program and question. I'm trying to write a function which will simply convert decimal time to Hours & Minutes. I'm removing the hours and multiplying the decimal minutes by 60 and adding the two back…
2
votes
1 answer

How do researchers manage to find such large primes?

This piqued my interest as I was trying to find a larger prime number, but I soon realised that the interpreter of my programming language soon popped an error when trying to insert a number with 24 million digits (2^82,589,933 − 1)to a variable. So…
2
votes
2 answers

R - Calculate time closest to X for each day

I have a dataset that looks like this: structure(list(value = c(0.22, 0.68, 0.55, 0.68, 0.48, 0.94), date = structure(c(1583964300, 1583979060, 1583986500, 1583992140, 1584000540, 1584003300), tzone = "UTC", class = c("POSIXct", …
Ibetthat
  • 67
  • 6
2
votes
1 answer

Dataframe calculation

I want to do the following calculation and the outcome has to be a new column Calculated trap.. test["calculation trap"] = (( 0.000164 + 0.000415)/2) so the outcome of this formula has to be 0.0002895. I tried the following code to do this…
RvBenthem
  • 35
  • 4
2
votes
2 answers

Calculating values in Lua to higher accuracy

The expression print(math.pi) gives values of pi as 3.1415926535898 up to 13 decimal places on my CPU with lua 5.3. Is it possible to get value up to more number of decimal places, for example value of math.pi upto 50 decimal places. If so, what…
Maths89
  • 476
  • 3
  • 15
2
votes
2 answers

How to calculate in PHP for payment gateway

I am integrating Payment Gateway with my PHP application. I am facing an issue during solving some basic small equation via JavaScript or PHP. actually my payment gateway takes some percentages from principal amount as they have own rules. I want…