Top "Integer" questions

Common datatype in many programming languages for representing a whole number.

unsigned long long type printing in hexadecimal format

I am trying to print out an unsigned long long like this: printf("Hex add is: 0x%ux ", hexAdd); but …

c integer printf
Safe integer parsing in Ruby

I have a string, say '123', and I want to convert it to the integer 123. I know you can …

ruby string exception integer string-parsing
An integer is required? open()

I have a very simple python script that should scan a text file, which contains lines formatted as id='value' …

python file-io integer argv
Integer to two digits hex in Java

I need to change a integer value into 2-digit hex value in Java.Is there any way for this. Thanks …

java integer hex
Is there a way to convert number words to Integers?

I need to convert one into 1, two into 2 and so on. Is there a way to do this with a …

python string text integer numbers
What happens if I assign a negative value to an unsigned variable?

I was curious to know what would happen if I assign a negative value to an unsigned variable. The code …

c++ type-conversion integer unsigned signed
Designing function f(f(n)) == -n

A question I got on my last interview: Design a function f, such that: f(f(n)) == -n Where n …

math integer
Check value of least significant bit (LSB) and most significant bit (MSB) in C/C++

I need to check the value of the least significant bit (LSB) and most significant bit (MSB) of an integer …

c++ c integer bit-manipulation bit
Visual Studio debugger - Displaying integer values in Hex

I'm using Visual Studio 2008 and I have just noticed that the debugger is displaying integer values as Hex when I …

debugging visual-studio-2008 integer hex
Define 16 bit integer in C

I need to declare an integer in the size of 16 bit, in C. I know that short and int sizes …

c integer 16-bit stdint