Top "Int" questions

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

What does this boolean "(number & 1) == 0" mean?

On CodeReview I posted a working piece of code and asked for tips to improve it. One I got was …

java methods arraylist boolean int
Python math range error

I'm getting an error when trying to calculate a very large number in Python. Here is my code: # Where fourthNumber = 2790 # …

python math int exponent
2 Chars to Short in C

I've got 2 chars. Char 128 and Char 2. How do I turn these chars into the Short 640 in C? I've tried unsigned …

c int type-conversion short
Why is a negative int greater than unsigned int?

int main(void) { unsigned int y = 10; int x = – 4; if (x > y) Printf("x is greater"); else Printf("y is …

c int unsigned signed
Why must a short be converted to an int before arithmetic operations in C and C++?

From the answers I got from this question, it appears that C++ inherited this requirement for conversion of short into …

c++ c int short integer-promotion
convert string to int use sstream

We want to convert string to int using sstream. But we don't know our string has an integer or not, …

c++ string int sstream
Most efficient way to use strcat() with a string and int?

I'm try to concatenate to char * rv with the result of a function call that will return an int. fib() …

c casting int concatenation strcat
UITextPosition to Int

I have a UISearchBar on which I am trying to set a cursor position. I am using UITectField delegates as …

ios objective-c uitextfield int uitextposition
Why would uint32_t be preferred rather than uint_fast32_t?

It seems that uint32_t is much more prevalent than uint_fast32_t (I realise this is anecdotal evidence). That …

c++ c int
C How to calculate a percentage(perthousands) without floating point precision

How do you calculate a percentage from 2 int values into a int value that represents a percentage(perthousands for more …

c floating-point embedded int percentage