Top "Negative-number" questions

A negative number is a number that is less than 0. It is signified by a preceding hyphen (i.e. -12,345).

HashCode giving negative values

I am converting the incoming string into hash code by doing the following function but some of the values are …

java hashcode negative-number
Right shifting negative numbers in C

I have C code in which I do the following. int nPosVal = +0xFFFF; // + Added for ease of understanding int nNegVal = …

c bit-shift negative-number
Random and negative numbers

I have to generate numbers in range [-100; +2000] in c++. How can I do this with rand if there is …

c++ random negative-number
Are hexadecimal numbers ever negative?

Are hexadecimal numbers ever negative? If yes then how? For binary you would have signed and unsigned. How would one …

java hex negative-number
Javascript Math Object Methods - negatives to zero

in Javascript I can't seem to find a method to set negatives to zero? -90 becomes 0 -45 becomes 0 0 becomes 0 90 becomes 90 …

javascript math negative-number
How to turn all numbers in a list into their negative counterparts?

I am trying to turn a list of positive numbers into a list of negative numbers with the same value …

python python-3.x list negative-number
Python: Removing negatives from a list of numbers

The question is to remove negatives from numbers. When remove_negs([1, 2, 3, -3, 6, -1, -3, 1]) is executed, the result is: [1, 2, 3, 6, -3, 1]. …

python list negative-number
Best way to make Java's modulus behave like it should with negative numbers?

In java when you do a % b If a is negative, it will return a negative result, instead of wrapping …

java modulo negative-number
How to check if a signed integer is neg or pos?

I am new to x86 assembly language, I have a signed integer saved in register eax, and I want to …

assembly x86 negative-number negative-integer
How to change a negative number to zero in python without using decision structures

I have a program that determines the number of points you get per day, for 5 days from an event. source …

algorithm python-3.x validation negative-number