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

Integer vs floating point multiplication in Python

I recently wrote a short Python program to calculate the factorial of a number as a test to see how much faster integer multiplication is compared to floating point multiplication. Imagine my surprise when I observed that it was the floating point…
DJElectric
  • 349
  • 1
  • 4
  • 18
2
votes
1 answer

How can I create a Trend Line in Amazon QuickSight?

I need to create a Trend calculation for a dashboard in Amazon QuickSight. Basically I need the same thing that the Trend function in Excel allows. Thanks!
sgn
  • 125
  • 2
  • 10
2
votes
3 answers

OLAP Cube Calculation for Last Year Comparison on Week Day - MDX

I want to compare actual sales values with sales values of last year. The difficulty in this comparison is the compliance of the week days and thereby of the leap-year. Example on day level: 2016-02-04 (thursday): actual sales: 580,- last year…
Alexo
  • 131
  • 4
  • 15
2
votes
4 answers

How to compare each cell in one column with a specific value in pandas?

I have a dataframe like this, I want to achieve this: if the sign of A is the same with the sign of B, get a new column C = min(3, |A|); if the sign of A is is different from the sign of B, C = min(3, B); if the values for A & B are zero, C=A Type…
wawawa
  • 2,835
  • 6
  • 44
  • 105
2
votes
1 answer

Sumproduct check if text is name of a named range and return those numbers

the user is able to enter either a number or a name into a cell. When i put a number, sumproduct is working fine, but when i want it to check if the name of a named range is inside the cell, it doesn't return…
Worempie
  • 35
  • 1
  • 8
2
votes
0 answers

Azure egress bandwidth calculation

I was wondering how Azure calculates the amount of network bandwidth. Is it bad ed on the number and size of packets that are moving out of a respective region. I am asking because I believe if a protocol is chatty or uses encryption, the amount…
2
votes
2 answers

how do i read information from the second column in my csv file, and use the data stored in each row of that column to calculate something?

I want to increase my basePremium(=200) by a certain percentage, the percentages are stored in rows of the second column in my csv file. the percentage will be determined by the selection the user makes from a drop-down list that has the values from…
kitty
  • 21
  • 1
  • 5
2
votes
2 answers

Issues calculating CRC16 MCRF4XX for more than 1 byte

I've been trying to perform CRC16 MCRF4XX in my code however I've managed to do it correctly for only 1 byte. I've followed this guide, for the specific method: http://www.piclist.com/techref/method/error/quickcrc16.htm and i've tested the same byte…
Barak
  • 23
  • 5
2
votes
1 answer

glht function in R giving different results compared to calculations done by hand

I am coding an example and comparing with results obtained by hand however the results are not consistent. The data set is about a study comparing a score for 3 different treatments. The data set can be reproduced as follows (relabelled for…
NM_
  • 1,887
  • 3
  • 12
  • 27
2
votes
1 answer

Prolog - increment by given number

I have a couple of linked elements with provided cost for traversing them: link(a, b, 100). link(b, c, 223). link(c, d, 311). I want to find whether the traversal is possible and if it is then return the total cost. So that the question ?-count(a,…
Xi Xamiti
  • 35
  • 4
2
votes
4 answers

Javascript Object month corresponding value calculation

want to get the total of num for each of the repeated months and leave the value for the unique months as it is in this array of object [ {num: 5000, month: "September"}, {num: 6000, month: "September"}, {num: 4500, month: "August"}, {num:…
okumu justine
  • 350
  • 6
  • 11
2
votes
1 answer

Populate a new array by looping through another array

I am working on some calculations. By user input, calculations should take place and build a table with data. My first array, calcTable is working as intended, each row however, represents a month. In my final table, I want a row to represent a…
Frank351
  • 67
  • 2
  • 9
2
votes
0 answers

C# split text by rectangle

I have a requirement. I need to split a string by fitting it into a Rectangle object. I have the string's Font, the regionSize (of size 1780x880), and a default StringFormat object. Here's my code: // file 1 public static class Utils { …
Tayab
  • 311
  • 2
  • 13
2
votes
0 answers

Why the displacement between two endpoints of joint clothoid doesn't match to that from simulation?

I want to calculate the displacement of two endpoints in a joint clothoid, but the result is different from the simulation result. Where is the problem of my calculation? image of three clothoids I calculate separated clothoid' displacements, then…
Roy Cheng
  • 21
  • 2
2
votes
2 answers

Scala: Tokenizing simple arithmetic expressions

How can I split 23+3*5 or 2 + 3*5 into a list List("23", "+", "3", "*", "5")?. I tried things like split, splitAt, but nothing with the wished result. I want that it splits at the arithmetic operators.
Lockna
  • 691
  • 1
  • 8
  • 24