Questions tagged [negative-integer]
34 questions
0
votes
2 answers
speed up sqlalchemy orm dynamic relationship slicing with negative indicies
I have the following SQLA models and relationships. I am logging a measurement for each channel every second, so there are lots of measurements in the DB.
class Channel( Model ) :
__tablename__ = 'channel'
id = Column(…

BrendanSimon
- 665
- 1
- 9
- 23
0
votes
3 answers
in Python, I get a wrong total, i only get the total of the positive numbers that are located before the negative ones
i wrote this code in python:
list=[3,5,7,6,-9,5,4]
i=0
total=0
while i 0:
total+=list[i]
i+=1
print(total)
and instead of getting the total of all positive numbers i only get the total of numbers that are located…

joxavy
- 9
- 8
0
votes
0 answers
In operator with one or More negative values not working with API Version 1.4 for Oracle Service Cloud
We have upgraded our application to use API version 1.4 and we observed the following error when ROQL query contains “in operator” with one or more negative values in the “in clause”. If all the values in the in clause are positive then this error…

Venkatesh
- 1
- 1
0
votes
0 answers
Convert byte to negative value and vice versa in VB
Dim A As String = String.Join("", "1F", "40")
Dim B As Integer = Convert.TonInt32(A,16)
return 8000.
My Questions
How to convert into hex in VB if my decimal value is in negative (i.e. -8000 or -80 as for example)?
How to convert into negative…

Joey
- 3
- 2
0
votes
0 answers
Program output becomes unstable when all negative inputs are introduced?
As the title suggests, my program which is designed to find the largest element within a user defined integer array becomes unstable when all negative numbers are used for the user input. Additionally the output becomes unstable when all zero's are…

Mr SnowGlobe
- 57
- 1
- 8
0
votes
6 answers
Print only negative numbers and its sum aplaying loops and arrays
I need help with a program, I have to use a loop to output all negative integers and their sum. I should use just basic method.
Negative integers: -2, -1, -7 <----//No comma at the end.
Sum negative nums: -10
When I run my program the last…

Chucho
- 3
- 3
0
votes
1 answer
How to generate Crc-64 table having all negative integer Constants and checksum?
I have some example code for Crc-64 Table generator. I tried to check the unsigned integer's sign and discovered that it generates mixed table Constants both negative & positive integers. Same for the Crc-64 Checksum, it may be negative or positive.…

Jain
- 1
- 2
0
votes
1 answer
problem with if-statement and negative integer
Really new to C#. I want to check if an integer (input from user) is positive, negative or zero. It works with the positive number and zero but not when I input a negative number!
I've tried to change input type from user to int, float, decimal,…

Alexxx
- 57
- 1
- 2
- 5
0
votes
1 answer
load on startup negative value in liberty
I am currently migrating my application from WAS 8 to WAS Liberty, and I am stuck with the below problem. In one of my module web.xml file, the servlet load on startup value is -1. And the particular servlet is not getting invoked while running in…

Venkatesh
- 31
- 1
- 7
0
votes
0 answers
prefix to infix conversion using singly linked list handling double digit and negative digits in C
I have been trying a lot but I cannot come up with an algorithm to convert prefix to Infix using singly linked list. Also I have to deal with integers -99 to 99. Can anyone at least provide me an algorithm to for this. Thank you very much!!
I am…

Ruby
- 3
- 4
0
votes
1 answer
How to get a number entered by the user to exit a loop?
I'm trying to get the user to input any number between 0 and 10 an unlimited amount of times until they want to stop. They stop by entering the value -1. So far i have been able to create what happens when they enter a correct value, but when they…

r2d2
- 1
- 1
-1
votes
1 answer
LUA, divide negative value
For example, I have vaule "a" = -23 who I want to print as -2.3
I write this code who work good when a > 0, also work in other language string_buf = string.format ( "%1d,%d" ,a //10, math.abs(a) %10) but when I use only use "//" then I have one more…

terefere
- 17
- 3
-2
votes
2 answers
Python adding Counter objects with negative numbers fails
why do adding an empty counter to another with a negative value results in 0
from collections import Counter
a=Counter({'a':-1})
b=Counter()
print(a+b)
Result
Counter()
but if the counter added to the empty one has a positive value it works. How…

wrbp
- 870
- 1
- 3
- 9
-2
votes
1 answer
Unsigned long long Fibonacci numbers negative?
I've written a simple Fibonacci sequence generator that looks like:
#include
void print(int c, int r) {
std::cout << c << "\t\t" << r << std::endl;
}
int main() {
unsigned long long int a = 0, b = 1, c = 1;
for (int r = 1; r…

user6245072
- 2,051
- 21
- 34
-3
votes
2 answers
How to make negative of a variable? C++
I apologize if this error is the result of a typo, but I can't figure out how to make my variable negative when the correct syntax should be y=-x;
std::cout << "loop size = " << loop_size_ << std::endl;
core::Size neg_loop_size_ =…

Amanda
- 202
- 1
- 3
- 8