1,493 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
4
answers
116
views
subtract list with same length [duplicate]
I want to subtract two list with the same length such it returns a list with same length, for example,
a = [1,2,3,4]
b = [5,4,3,7]
a-b=[1-5,2-4,3-3,4-7]=[-4,-2,0,-3]
is there any method?
3
votes
2
answers
184
views
Why does sqrt(x+1)-sqrt(x) result to 0 in JS? [duplicate]
I’m trying to compute the difference between two square roots in JS.
function deltaSqrt(x) {
return Math.sqrt(x + 1) - Math.sqrt(x);
}
console.log(deltaSqrt(1e6)); // 0.0004999998750463419
...
1
vote
1
answer
25
views
Finding the Difference From the Last Number in a Column of Numbers
I need to calculate a simple subtraction of one cell value "Yearly Difference" to another cell value "Amount" based on the month. The issue is the last cell value will be in a ...
1
vote
1
answer
66
views
Subtract constant 1 from pivot table in excel
I have a pivot table with a numerical column. I want to subtract number '1' from 'count of serial number' column. I tried to use Fields, Items, sets and entered formula as = ='Number' - 1. But this ...
1
vote
3
answers
135
views
Excel subtract big numbers as hours and minutes
The subtracting 36716.09 from 28961.49 (36716.09 - 28961.49, ‘.’dot is separator represents minutes: 9 minutes and 49 respectively) yields 7754.60 Which accounts for 7755 hours.
However, the correct ...
5
votes
3
answers
262
views
int64_t can't accommodate an actual result of subtraction
I know that if I need to substract one 32-bit number from another, as a result vairable I should use 64-bit type.
E.g.
uint32_t a = 1, b = 3123456789;
int diff = a - b;
is wrong because diff cannot ...
0
votes
2
answers
65
views
Sum Case when statement using Condition 1 minus Condition 2
I have a table that contains product totals as well as a pre-calculated grand total
Type
Agent
Rev
Product 1
Agent 1
100
Product 2
Agent 1
90
Product 3
Agent 1
200
GrandTotal
Agent 1
390
I can SUM ...
1
vote
1
answer
65
views
Why am I getting Pycharm Operand Error in my code? [duplicate]
I am getting an operand error in pycharm, and I don't understand why because in pycharm instant feedback sense, the code is correct.
What is your name?
How old are you?
Traceback (most recent call ...
0
votes
2
answers
72
views
Getting wrong output after simple subtraction
How is it possible to get given output with code below?
#include <iostream>
#include <vector>
#include <future>
#include <algorithm>
#include <cmath>
using namespace std;...
0
votes
0
answers
85
views
Subtraction of doubles in c++
I have been doing some scientific computing working lot with very small and very big doubles with values in range between 1e-50 and 1e50. Nevertheless, the values never reach double limits, i.e. no ...
0
votes
1
answer
118
views
Correct way to add and subtract significant figures
There are actually two ways given to add or subtract significant figures in different books .In books like concepts of Physics by HC Verma it is written that round of the numbers given first and then ...
0
votes
1
answer
42
views
How to subtract sample data set from parent data set on base of index?
How to get a train data set with 7 rows from a main data set of 10 rows after creating a test data set with 3 random rows, I need to subtract the test data set from the main data set. However, I need ...
0
votes
2
answers
101
views
How To Subract a Number Inside of a List Consecutively?
I want to subract a number inside of a list consecutively.
Let's say I have a list name A.
A = [6, 7, 9, 5]
Subtract 6 - 7, so it's -1. Then, subtract -1 - 9, it's -10. Then, subtract -10 - 5, it's -...
-1
votes
3
answers
73
views
Subtracting list values from previous list values
If I have a list of values like this:
a=[5,4,3,2,1]
How would I then go about subtracting a value from the one before it and storing it in a new list? In this example, the new list would look like:
...
-1
votes
1
answer
176
views
Subtract unsigned ints into signed long result. Never negative?
Found a bug in my code and noticed the following, when subtracting 2 numbers like
unsigned int a, b (with b > a)
signed long result = a - b
The result is always positive, even though b is larger. I ...
user avatar
user6342701