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 perfectly place a gameObject on a mesh through C# script in unity?

Summary: I have a gameobject that have a rock mesh. However, the bottom of the mesh is hallow and ugly. I want to place it on a mesh that looks like a hill, so that the player cannot see the gameobject's ugly and hallow bottom. I have a script that…
Tommy
  • 349
  • 4
  • 13
2
votes
0 answers

Adobe Javascript Calculation Errors

I want to check fields "Code1 to Code 32" for anything starting with "A" and ending with "B". I want the count to output to the field "Total1". I input the code under properties of "Total1" in the custom calculation. The Javascript doesn't…
Odigo
  • 21
  • 1
2
votes
2 answers

Register basket calculation result view

We are trying to implement our own custom basket calculation rule set and register new result view to get basket calculation results, but we are unable to find some info how to register new result view class? We are using examples from here:…
Goran Petanjek
  • 444
  • 2
  • 11
2
votes
1 answer

Javascript calculations and php calculations mismatch

I have to do some calculations in JavaScript in client side and I have to validate in PHP when the user clicks on submit. When doing so I am getting different results in PHP and JavaScript. I have the below problems. 1. JavaScript calculations gives…
svkks
  • 95
  • 2
  • 10
2
votes
3 answers

jQuery loop through strings calculate percentage discount from string values

I'm currently trying to calculate the percentage off -- or difference in percent between two prices on a web store. I also need to be able to loop through all items on the page that have the same classname applied. Inside the class name div there is…
ben.kaminski
  • 986
  • 3
  • 13
  • 24
2
votes
1 answer

Keyup and calculate value from database and display on input

I need to calculate the value and show on his own row total E.g. select an item and show the per unit, input quantity and show another initial price and lastly add discount and area discount and show total amount. Tried to use keyup function but it…
Doing Life
  • 33
  • 6
2
votes
4 answers

How can you force bc to follow the scale?

I want to calculate the percentage of a few numbers upto 2 decimal places. Since my total count is pretty high, dividing 100 by it gives a really small number (0.000..) so for this step I have a large scale of 10. The second step where i multiply…
KA97
  • 39
  • 1
  • 5
2
votes
2 answers

How to calculate percentage difference between two data frames with Pandas?

I'm using pandas, and I perform some calculations and transformations, where I end up with two data frames that look more or less like this: ID 'abc' 'def' Total 4 5 Slow 0 0 Normal 1 2 Fast 3 …
user9128740
2
votes
4 answers

Python - Print output instead of formula

I'm new with Python and got no experience with any programming languages so far. I have to complete an exercise but I can't get the desired output. I need to give x a value of 0, 1 and -1. And y should have the expected outcome of -1.0, 3.0 and…
Niels93
  • 29
  • 1
  • 2
2
votes
0 answers

Calculate deltaE94 in javascript

I'm trying to calculate the Cie94 Delta-E from two colors eg. hexA and hexB - somewhere I found some code which I tried to adjust. Somehow the calculated results aren't correct. My reference is this site:…
Game Unity
  • 125
  • 10
2
votes
1 answer

Chess piece legal moves

I made a chess game with vue.js, and right now I am trying to figure out the possible moves of each piece. I was able to fix legal moves validation for knight, pawn and bishop. While working with bishop validation, I meet a problem. It is to be able…
Alen.Toma
  • 4,684
  • 2
  • 14
  • 31
2
votes
2 answers

Why are the following codes giving me different output? (Square root big numbers)

I'm currently trying to simulate a message mapping on elliptic curve, and I am trying to find a point on the curve y**2 = (x**3 + a*x + b) % p, by setting the x variable as hexadecimal converted string. However, I don't know whether it's the problem…
user65311
  • 23
  • 2
2
votes
0 answers

How to calculate pulling Object?

I would like to generate a kind of moving object that "follows" another object. You can imagine it like a car with 2 ropes (back left and back right) pulling a small sled after it. I don't know for sure how I can calculate the position of this sled…
user3596335
2
votes
2 answers

Divs height relative to some number value inside the div

I have a set of blocks, each have some associated number. I need to make blocks height correspond to this number. For example As you can see the bigger number - the higher is div. But its not 1:1 related, right? Otherwise we would not even see the…
Anna
  • 2,911
  • 6
  • 29
  • 42
2
votes
2 answers

Get column sum and use to calculate percent of total, why doesn't work with CTEs

I did this following query, however it gave the the result of 0 for each orderStatusName, does anyone know where is the problem? with tbl as ( select s.orderstatusName, c.orderStatusId,count(c.orderId) counts from [dbo].[ci_orders] c…
Tea
  • 23
  • 2