Top "Int" questions

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

set double format with 2 decimal places

I have a short equation: double compute,computed2; compute=getminutes/60; where getminutes is int and I want to set the …

java swing int decimal decimalformat
How can I declare that a text field can only contain an integer?

In swift, I am trying to make a text field that will allow a button to be enabled, but only …

text swift int uitextfield textfield
Java - Explicit Conversion from Int to Short

Can someone please explain why this following statement: short value = (short) 100000000; System.out.println(value); Gives me: -7936 Knowing that …

java variables casting int short
C: cast int to size_t

What is the proper way to convert/cast an int to a size_t in C99 on both 32bit and 64…

c casting int c99 size-t
Using Exclamation Marks '!' in C

I have come across a problem involving exclamation marks and integers whilst reading a code in my reference book. Let …

c int punctuation
string::size_type instead of int

const std::string::size_type cols = greeting.size() + pad * 2 + 2; Why string::size_type? int is supposed to work! it holds …

c++ string int size-type
int array initialization

I have here a simple question related to Java. Let's say you have an int array as instance variable: int[] …

java arrays initialization int default-value
convert int to short in C

I have: int a = 2147483647; short b = (short)a; and I get b = -1 whereas I expect int32 to be converted …

c int short
Java: Integer division round up

I'm trying to write a program that prompts the user to enter the total amount of floors in a hotel, …

java int percentage
Hashcode of an int

What is the hashcode of a primitive type, such as int? for example, let's say num was an interger. int …

java int hashcode primitive