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).

Create a random number between -100 and 100 in JavaScript?

Possible Duplicate: Generating random numbers in Javascript I have the following code var randomnumber=Math.floor(Math.random()*101); that generates …

javascript random range negative-number
how to convert negative integer value to hex in python

I use python 2.6 >>> hex(-199703103) '-0xbe73a3f' >>> hex(199703103) '0xbe73a3f' …

python integer hex negative-number
Format Negative numbers in parenthesis BUT NOT with $ symbol?

I have seen all over the internet to format a NEGATIVE double value with a parenthesis WITH a $ symbol ie. …

.net vb.net parentheses negative-number
how to convert negative hexadecimal to decimal

hi I want to know how it is possible to convert a hexadecimal negative value (to complement encoding) to decimal, …

c encoding numbers decimal negative-number
In Python, what is a good way to round towards zero in integer division?

1/2 gives 0 as it should. However, -1/2 gives -1 , but I want it to round towards 0 (i.e. I want -1/2 …

python rounding division negative-number integer-division
Java: right shift on negative number

I am very confused on right shift operation on negative number, here is the code. int n = -15; System.out.…

java bit-manipulation bitwise-operators bit-shift negative-number
Reject Negative Numbers as exceptions in Python

I'm trying to run a basic prompt that takes a number, then runs a recursive function on it. Any negative …

python exception negative-number
2's complement hex number to decimal in java

I have a hex string that represents a 2's complement number. Is there an easy way (libraries/functions) to translate …

java hex twos-complement negative-number
Detecting and adjusting for negative zero

I have some code that has been port from Java to C++ // since this point is a vector from (0,0,0), we …

c++ algorithm negative-number
Python Range() for positive and negative numbers

Okay, so I'm trying to write a simple program that gives me both the positive and negative range of the …

python-2.7 range negative-number