I am attempting to devise a system for packing integer values greater than 65535 into a ushort. Let me explain.
We have a system which generates Int32 values using an IDENTITY column from SQL Server and are limited by an in-production client API that overflows our Int32 IDs to ushorts. Fortunately the client only has about 20 or so in...
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 performance difference for using UInt32 vs Int32?
...
Hi.
System.Console.WriteLine(int.MaxValue);
This line gives me the answer of 2147483647 as I have a 32-bit PC.
Will the answer be same on a 64-bit PC?
...
You know how System.Drawing.Rectangle was replaced by System.Windows.Int32Rect? (As far as non-floating-point shapes are concerned ...)
Is there a similar new object for an integer point or size? If not, I'll just use System.Drawing - but that kinda seems like a minor mix of two platforms that ought not to me mixed.
Anyway, what do...
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?
...
Consider this
int i = 2147483647;
var n = i + 3;
i = n;
Console.WriteLine(i); // prints -2147483646 (1)
Console.WriteLine(n); // prints -2147483646 (2)
Console.WriteLine(n.GetType()); // prints System.Int32 (3)
I am confused with following
(1) how coul...
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?
...
I'm re-writing alibrary with a mandate to make it totally allocation free. The goal is to have 0 collections after the app's startup phase is done.
Previously, there were a lot of calls like this:
Int32 foo = Int32.Parse(ASCIIEncoding.ASCII.GetString(bytes, start, length));
Which I believe is allocating a string. I couldn't find a ...
I am doing some custom serializing, and in order to save some space, i want to serialize the decimals as int, if possible value wise. Performance is a concern, since i am dealing with a high volume of data. The current method i use is:
if ((value > Int32.MinValue) && (value < Int32.MaxValue) && ((valueAsInt = Decimal.ToInt32(value)) == ...
Whats the mathematical formulae to calculate the MIN and MAX value of an integral type using your calculator. I know you can use Integer.Max or Integer.Min etc or look it up on msdn however I want to know how to calculate it.
...
In C#, when messing with that system DLLImport/(unmanaged?) code stuff, I read somewhere it's important to use Int32 exact type instead of int. Is this true? And can someone please elaborate on why it's important to do this?
...
I am passing query string and the url is as follows-> http://localhost:1086/Web/EditMobile.aspx?sno=2.
But when i try to enter the url as follows,localhost:1086/Web/EditMobile.aspx?sno=2*3424324423432424* , i get the following error->Value was either too large or too small for an Int32. How do i handle this error. I must get an error re...
No exception is thrown, function just halts at this statement:
int productQuantity = Convert.ToInt32("1.00");
and returns.
What am I doing wrong to convert this float to Int32?
Note: I am running in a BackgroundWorkerThread.
...