tagged [integer]
How to get the Enum Index value in C#
How to get the Enum Index value in C# In C, `enums`, internally equates to an integer. Therefore we can treat data types of `enum` as integer also. How to achieve the same with C#?
Declaring an unsigned int in Java
Declaring an unsigned int in Java Is there a way to declare an unsigned int in Java? Or the question may be framed as this as well: What is the Java equivalent of unsigned? `String.hashcode()`
Convert string with comma to integer
Convert string with comma to integer Is there any neat method to convert "1,112" to integer 1112, instead of 1? I've got one, but not neat:
- Modified
- 8 Mar at 03:19
Can I convert long to int?
Can I convert long to int? I want to convert `long` to `int`. If the value of `long` > `int.MaxValue`, I am happy to let it wrap around. What is the best way?
- Modified
- 6 Nov at 10:16
Extract a single (unsigned) integer from a string
Extract a single (unsigned) integer from a string I want to extract the digits from a string that contains numbers and letters like: I want to extract the number `11`.
- Modified
- 22 Nov at 10:33
What is the conversion specifier for printf that formats a long?
What is the conversion specifier for printf that formats a long? The `printf` function takes an argument type, such as `%d` or `%i` for a `signed int`. However, I don't see anything for a `long` value...
- Modified
- 4 Nov at 21:1
Difference of using int and uint and when to use
Difference of using int and uint and when to use What is the difference between using int and uint? All the examples I have seen so far are using int for integers. Any advantage of using uint? Thanks.
- Modified
- 11 Nov at 17:26
Parse v. TryParse
Parse v. TryParse What is the difference between Parse() and TryParse()? Is there some form of error-checking like a Try-Catch Block?
How could I convert data from string to long in c#
How could I convert data from string to long in c# How could i convert data from string to long in C#? I have data now i want it in
- Modified
- 27 Jun at 04:40
PHP - Large Integer mod calculation
PHP - Large Integer mod calculation I need to calculate modulus with large number like : It's not working... because $largenum is too big for an int in PHP. Any idea how to do this ?
Convert integers to written numbers
Convert integers to written numbers Is there an efficient method of converting an integer into the written numbers, for example: would return "Twenty One". Is there any way of doing this that doesn't ...
What is the maximum float in Python?
What is the maximum float in Python? I think the maximum integer in python is available by calling `sys.maxint`. What is the maximum `float` or `long` in Python? --- [Maximum and Minimum values for in...
- Modified
- 29 Jan at 11:51
How to concatenate a std::string and an int
How to concatenate a std::string and an int I thought this would be really simple, but it's presenting some difficulties. If I have How do I combine them to get a single string `"John21"`?
- Modified
- 17 May at 14:39
How to convert an IPv4 address into a integer in C#?
How to convert an IPv4 address into a integer in C#? I'm looking for a function that will convert a standard IPv4 address into an Integer. Bonus points available for a function that will do the opposi...
C#: How to convert long to ulong
C#: How to convert long to ulong If i try with BitConverter,it requires a byte array and i don't have that.I have a Int32 and i want to convert it to UInt32. In C++ there was no problem with that.
- Modified
- 27 Mar at 05:36
Int division: Why is the result of 1/3 == 0?
Int division: Why is the result of 1/3 == 0? I was writing this code: The result is 0. Why is this, and how do I solve this problem?
- Modified
- 14 Dec at 18:25
What do numbers using 0x notation mean?
What do numbers using 0x notation mean? What does a `0x` prefix on a number mean? It's from a C program. I can't recall what it amounts to and particularly what the letter `x` means.
How can I convert an int to a string in C?
How can I convert an int to a string in C? How do you convert an `int` (integer) to a string? I'm trying to make a function that converts the data of a `struct` into a string to save it in a file.
Get int from String, also containing letters, in Java
Get int from String, also containing letters, in Java How can I get the int value from a string such as `423e` - i.e. a string that contains a number but also maybe a letter? `Integer.parseInt()` fail...
How to get the separate digits of an int number?
How to get the separate digits of an int number? I have numbers like 1100, 1002, 1022 etc. I would like to have the individual digits, for example for the first number 1100 I want to have 1, 1, 0, 0. ...
Integer formatting, padding to a given length
Integer formatting, padding to a given length I need to pad the output of an integer to a given length. For example, with a length of 4 digits, the output of the integer 4 is "0004" instead of "4". Ho...
Java integer to byte array
Java integer to byte array I got an integer: `1695609641` when I use method: gives: but I want a byte array: How can I make this?
Why I cannot the get percentage by using Int
Why I cannot the get percentage by using Int Please forgive my programming knowledge. I know this is a simple thing, but I do not understand why result is always 0. Why decimal will be fine? Many than...
- Modified
- 8 Apr at 18:27