Questions tagged [int32]

int32 is a datatype that represents an integer and is coded on 32 bits in memory.

int32 is a datatype that represents an (a whole number, not a fraction) and is coded on 32 bits in memory. Unlike its counterpart which is , int32 can be used to store positive and negative integers, of values between -231 to 231 - 1.

187 questions
83
votes
6 answers

Int to byte array

I thought .net had some kind of easy conversion method to use for converting an int into a byte array? I did a quick search and all solutions are bit masking/shifting one byte at a time, like "the good ol days". Is there not a ToByteArray() method…
Brady Moritz
  • 8,624
  • 8
  • 66
  • 100
35
votes
3 answers

What is the int.MaxValue on a 64-bit PC?

System.Console.WriteLine(int.MaxValue); This line gives me the answer of 2,147,483,647 as I have a 32-bit PC. Will the answer be same on a 64-bit PC?
g.revolution
  • 11,962
  • 23
  • 81
  • 107
35
votes
2 answers

C# int, Int32 and enums

If int is synonymous to Int32 why does enum MyEnum : Int32 { Value = 1 } ...not compile? Where as enum MyEnum : int { Value = 1 } will, even though hovering the cursor over the int word will display struct System.Int32?
user110714
33
votes
2 answers

Isn't an Int64 equal to a long in C#?

I have been playing around with SQL and databases in C# via SqlCeConnection. I have been using ExecuteReader to read results and BigInt values for record IDs which are read into Longs. Today I have been playing with SQL statements that use COUNT…
user427165
27
votes
2 answers

how to convert Int32 value to CGFloat in swift?

Here my code. I am passing two values into CGRectMake(..) and getting and error. let width = CMVideoFormatDescriptionGetDimensions(device.activeFormat.formatDescription as CMVideoFormatDescriptionRef!).width // return Int32 value let height =…
iosLearner
  • 1,312
  • 1
  • 16
  • 30
24
votes
6 answers

Why is Int32's maximum value 0x7FFFFFFF?

I saw in MSDN documents that the maximum value of Int32 is 2,147,483,647, hexadecimal 0x7FFFFFFF. I think, if it's Int32 it should store 32-bit integer values that finally should be 4,294,967,295 and hexadecimal 0xFFFFFFFF. My question is why Int32…
Afshin Mehrabani
  • 33,262
  • 29
  • 136
  • 201
23
votes
1 answer

Is there any difference between Integer and Int32 in VB.NET?

In VB.NET, is there any difference between Integer and Int32? If yes, please explain.
Vikram
  • 3,996
  • 8
  • 37
  • 58
22
votes
5 answers

What is the difference between Int32 and UInt32?

What is the difference between Int32 and UInt32? If they are the same with capacity range capabilities, the question is for what reason UInt32 was created? When should I use UInt32 instead of Int32?
Fitzchak Yitzchaki
  • 9,095
  • 12
  • 56
  • 96
21
votes
7 answers

Double parse with culture format

I have a double number as string. The number is 202.667,40 Which is 202667.4 How can I parse this string to get the value like: Double.Parse("202.667,40",?what here), or any other method to get the value would be great. Thanks
Ryan
  • 5,456
  • 25
  • 71
  • 129
21
votes
4 answers

Why does Convert.ToInt32() round to the nearest even number, instead of nearest whole number?

Looking at the msdn documentation for Convert.ToInt32() it states: If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to…
Curtis
  • 101,612
  • 66
  • 270
  • 352
20
votes
2 answers

Difference between int32_t and int_fast32_t

What is the difference between the two? I know that int32_t is exactly 32 bits regardless of the environment but, as its name suggests that it's fast, how much faster can int_fast32_t really be compared to int32_t? And if it's significantly faster,…
starcodex
  • 2,198
  • 4
  • 22
  • 34
17
votes
8 answers

In C# is there any significant performance difference for using UInt32 vs Int32

I am porting an existing application to C# and want to improve performance wherever possible. Many existing loop counters and array references are defined as System.UInt32, instead of the Int32 I would have used. Is there any significant…
Noah
  • 15,080
  • 13
  • 104
  • 148
12
votes
3 answers

LINQ to Entities does not recognize the method 'Int32 Parse(System.String)' method, and this method cannot be translated into a store expression

I am using Entity Framework, and I have a line of code that is taking a var and translating it back to an iint for the database. var record = context.enrollments.SingleOrDefault (row => row.userId == int.Parse(UserID) && row.classId ==…
SinceForever
  • 232
  • 1
  • 2
  • 12
11
votes
3 answers

Cannot perform 'Like' operation on System.Int32 and System.String. DataGridView search and filter

I have a form that when I select a column name from a ComboBox, and type in a text box it filters and displays the searched criteria in the DataGridView. When I search for "Reference" which is an int data type, which is also identity, and primary…
user3237403
  • 163
  • 1
  • 2
  • 10
11
votes
2 answers

Python Numpy : np.int32 "slower" than np.float64

I would like to understand a strange behavior of python. Let us consider a matrix Mwith shape 6000 x 2000. This matrix is filled with signed integers. I want to compute np.transpose(M)*M. Two options: When I do it "naturally" (i.e. without…
ThR37
  • 3,965
  • 6
  • 35
  • 42
1
2 3
12 13