Click here to Skip to main content
15,898,984 members
Home / Discussions / C#
   

C#

 
QuestionCan I use Crystal Report in Runtime? Pin
bania22-Apr-03 14:48
bania22-Apr-03 14:48 
GeneralChanging Column Header Text in DataGrid control Pin
Konrad Rotuski22-Apr-03 12:41
Konrad Rotuski22-Apr-03 12:41 
GeneralRe: Changing Column Header Text in DataGrid control Pin
Alexander German23-Apr-03 8:22
Alexander German23-Apr-03 8:22 
GeneralRe: Changing Column Header Text in DataGrid control Pin
Konrad Rotuski23-Apr-03 8:48
Konrad Rotuski23-Apr-03 8:48 
GeneralC# FAQ for C++ Developers Pin
Kant22-Apr-03 11:48
Kant22-Apr-03 11:48 
GeneralRe: C# FAQ for C++ Developers Pin
Alvaro Mendez22-Apr-03 15:37
Alvaro Mendez22-Apr-03 15:37 
GeneralCInt(), Int32.Parse(), Convert.ToInt32() Pin
kensai22-Apr-03 9:53
kensai22-Apr-03 9:53 
GeneralRe: CInt(), Int32.Parse(), Convert.ToInt32() Pin
David Stone22-Apr-03 10:04
sitebuilderDavid Stone22-Apr-03 10:04 
CInt is a VB.NET thing...so I wouldn't touch that. Poke tongue | ;-P

Convert.ToInt32() looks like this:

public static int ToInt32(double value) {
	int local0;
	double local1;
	int local2;
	double local3;

	if (value >= 0) {
		if (value >= 2.14748e+009)
			goto i1;
		local0 = (int) value;
		local1 = value - (double) local0;
		if (local1 > 0.5 || local1 == 0.5 && local0 & 1 != 0)
			local0++;
		return local0;
	}
	if (value >= -2.14748e+009) {
		local2 = (int) value;
		local3 = value - (double) local2;
		if (local3 < -0.5 || local3 == -0.5 && local2 & 1 != 0)
			local2 = local2 - 1;
		return local2;
	}
	i1: throw new OverflowException(Environment.GetResourceString("Overflow_Int32"));
}


Int32.Parse() looks like this:

public static int Parse(string s) {
	return Int32.Parse(s, 7, null);
}

public static int Parse(string s, NumberStyles style, IFormatProvider provider) {
	NumberFormatInfo local0;

	local0 = NumberFormatInfo.GetInstance(provider);
	NumberFormatInfo.ValidateParseStyle(style);
	return Number.ParseInt32(s, style, local0);
}


And Number.ParseInt32 is an extern method that calls into the CLR itself.

So, the Convert class does a lot of math checking and stuff like that. The Int32 implementation calls into the core of the CLR. So you may want to do some timer work to find out what is the fastest implementation.


Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...

-Anna-Jayne Metcalfe on Paintballing

GeneralRe: CInt(), Int32.Parse(), Convert.ToInt32() Pin
Alvaro Mendez23-Apr-03 4:03
Alvaro Mendez23-Apr-03 4:03 
GeneralRe: CInt(), Int32.Parse(), Convert.ToInt32() Pin
Nick Parker23-Apr-03 4:39
protectorNick Parker23-Apr-03 4:39 
QuestionModifying the Executable at RunTime? Pin
Dire_st22-Apr-03 7:37
Dire_st22-Apr-03 7:37 
AnswerRe: Modifying the Executable at RunTime? Pin
Eric Gunnerson (msft)22-Apr-03 11:42
Eric Gunnerson (msft)22-Apr-03 11:42 
GeneralDatabase connection in c# Pin
nthomson22-Apr-03 5:02
nthomson22-Apr-03 5:02 
GeneralRe: Database connection in c# Pin
Ed K22-Apr-03 5:12
Ed K22-Apr-03 5:12 
GeneralRe: Database connection in c# Pin
nthomson22-Apr-03 5:24
nthomson22-Apr-03 5:24 
GeneralRe: Database connection in c# Pin
Ray Cassick22-Apr-03 5:35
Ray Cassick22-Apr-03 5:35 
GeneralRe: Database connection in c# Pin
nthomson22-Apr-03 6:35
nthomson22-Apr-03 6:35 
QuestionAny converters for C++? Pin
Kant22-Apr-03 3:31
Kant22-Apr-03 3:31 
AnswerRe: Any converters for C++? Pin
Stephane Rodriguez.22-Apr-03 4:40
Stephane Rodriguez.22-Apr-03 4:40 
GeneralRe: Any converters for C++? Pin
Kant22-Apr-03 5:09
Kant22-Apr-03 5:09 
GeneralRe: Any converters for C++? Pin
Stephane Rodriguez.22-Apr-03 5:36
Stephane Rodriguez.22-Apr-03 5:36 
GeneralRe: Any converters for C++? Pin
Kant22-Apr-03 6:01
Kant22-Apr-03 6:01 
GeneralRe: Any converters for C++? Pin
Alvaro Mendez22-Apr-03 6:10
Alvaro Mendez22-Apr-03 6:10 
GeneralRe: Any converters for C++? Pin
Stephane Rodriguez.22-Apr-03 6:41
Stephane Rodriguez.22-Apr-03 6:41 
GeneralVS .NET Startpage only shows "My Profile" Pin
STW22-Apr-03 0:24
STW22-Apr-03 0:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.