Click here to Skip to main content
15,915,869 members
Home / Discussions / C#
   

C#

 
GeneralControl vs UserControl Pin
Ivan Fernandez3-Dec-04 1:43
Ivan Fernandez3-Dec-04 1:43 
Generalcalculation during compile time Pin
dkoder3-Dec-04 1:21
dkoder3-Dec-04 1:21 
GeneralRe: calculation during compile time Pin
Felix Cho3-Dec-04 1:45
Felix Cho3-Dec-04 1:45 
GeneralAdding attributes to inherited members Pin
Paul Watson3-Dec-04 0:51
sitebuilderPaul Watson3-Dec-04 0:51 
GeneralRe: Adding attributes to inherited members Pin
Daniel Turini3-Dec-04 1:02
Daniel Turini3-Dec-04 1:02 
GeneralUsing FTP Pin
Member 10976992-Dec-04 22:50
Member 10976992-Dec-04 22:50 
GeneralRe: Using FTP Pin
Daniel Turini3-Dec-04 1:05
Daniel Turini3-Dec-04 1:05 
GeneralRe: Using FTP Pin
Alex Korchemniy3-Dec-04 3:25
Alex Korchemniy3-Dec-04 3:25 
QuestionPassing data from a static method? Pin
DaLLe1232-Dec-04 21:24
DaLLe1232-Dec-04 21:24 
AnswerRe: Passing data from a static method? Pin
Vector72-Dec-04 22:53
Vector72-Dec-04 22:53 
GeneralRe: Passing data from a static method? Pin
DaLLe1232-Dec-04 23:00
DaLLe1232-Dec-04 23:00 
AnswerRe: Passing data from a static method? Pin
Stefan Troschuetz2-Dec-04 23:04
Stefan Troschuetz2-Dec-04 23:04 
Generalsystem notification in Window Pin
ppp0012-Dec-04 20:35
ppp0012-Dec-04 20:35 
GeneralRe: system notification in Window Pin
Sebastian Schneider3-Dec-04 1:13
Sebastian Schneider3-Dec-04 1:13 
GeneralI want a two dimensional matrix of boxes on my fom. Pin
Anonymous2-Dec-04 19:37
Anonymous2-Dec-04 19:37 
GeneralRe: I want a two dimensional matrix of boxes on my fom. Pin
Dave Kreskowiak3-Dec-04 4:50
mveDave Kreskowiak3-Dec-04 4:50 
GeneralXP/2003 Icons Pin
Brendan Vogt2-Dec-04 19:33
Brendan Vogt2-Dec-04 19:33 
GeneralRe: XP/2003 Icons Pin
Tom John3-Dec-04 2:47
Tom John3-Dec-04 2:47 
Questionint casting does not behave with Math.Round with NaN? Pin
Felix Cho2-Dec-04 19:24
Felix Cho2-Dec-04 19:24 
Found a weird bug in an app that we are writing, and I narrowed down to this special case:
<br />
	double a = double.NaN;<br />
	Console.WriteLine("a = {0}", a);<br />
	Console.WriteLine("(int)a = {0}", (int)a);<br />
	Console.WriteLine("Math.Round(a) = {0}", Math.Round(a));<br />
	Console.WriteLine("(int)Math.Round(a) = {0}", (int)Math.Round(a));<br />

We just moved to 1.1 so this appears to be a 1.1 issue.

For debug build, the output is:
<br />
a = NaN<br />
(int)a = 0<br />
Math.Round(a) = NaN<br />
(int)Math.Round(a) = 0<br />

For release build, the output is:
<br />
a = NaN<br />
(int)a = 0<br />
Math.Round(a) = NaN<br />
(int)Math.Round(a) = -2147483648<br />

It seemed for some reason Release does not behave the same and that was causing my problem. Granted I shouldn't depend on the cast to be 0 because it is NaN (should never depend on undefined behaviour Poke tongue | ;-P ), but at least give me a consistent answer or throw an exception if NaN is used in Math.Round()?

Again when my runtime was 1.0 it seemed fine, so could this be just a weird bug? Confused | :confused:
AnswerRe: int casting does not behave with Math.Round with NaN? Pin
Felix Cho3-Dec-04 4:43
Felix Cho3-Dec-04 4:43 
AnswerRe: int casting does not behave with Math.Round with NaN? Pin
Dave Kreskowiak3-Dec-04 5:02
mveDave Kreskowiak3-Dec-04 5:02 
QuestionHow Can I have an Label Control array of two dimensional On form. Pin
Anonymous2-Dec-04 19:08
Anonymous2-Dec-04 19:08 

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.