Top "Int" questions

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

How to round a Double to the nearest Int in swift?

I'm trying to make a calculator of growth rate (Double) that will round the result to the nearest Integer and …

swift int double rounding
Haskell: Converting Int to String

I know you can convert a String to an number with read: Prelude> read "3" :: Int 3 Prelude> read "3" :: Double 3.0 …

string haskell int casting
How to check if an integer is within a range of numbers in PHP?

How can I check if a given number is within a range of numbers?

php range int
Rounding integer division (instead of truncating)

I was curious to know how I can round a number to the nearest whole number. For instance, if I …

c math int rounding integer-division
Converting a double to an int in Javascript without rounding

In C# the following code returns 2: double d = 2.9; int i = (int)d; Debug.WriteLine(i); In Javascript, however, the only …

javascript casting floating-point int
percentage of two int?

I want to get two ints, one divided by the other to get a decimal or percentage. How can I …

java int decimal
How to check if an integer is within a range?

Is there a way to test a range without doing this redundant code: if ($int>$min && $int&…

php int range
Convert unsigned int to signed int C

I am trying to convert 65529 from an unsigned int to a signed int. I tried doing a cast like this: …

c int unsigned-integer
int main() vs void main() in C

In C, I know that int main() returns an int where void main() does not. Other than that, is there …

c int main void
Quickest way to convert a base 10 number to any base in .NET?

I have and old(ish) C# method I wrote that takes a number and converts it to any base: string …

c# .net int base number-systems