Click here to Skip to main content
15,901,426 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: How Can I have an Label Control array of two dimensional On form. Pin
Tom John3-Dec-04 2:53
Tom John3-Dec-04 2:53 
QuestionHow Can I have an Label Control array of two dimensional On form. Pin
Anonymous2-Dec-04 19:08
Anonymous2-Dec-04 19:08 
GeneralMaking button visible in all rows in datagrid Pin
jagan792-Dec-04 18:13
jagan792-Dec-04 18:13 
GeneralPassing ComboBox Items Pin
azusakt2-Dec-04 17:13
azusakt2-Dec-04 17:13 
GeneralRe: Passing ComboBox Items Pin
Stefan Troschuetz2-Dec-04 21:24
Stefan Troschuetz2-Dec-04 21:24 
Generalpass point list to c++ function Pin
cchere2-Dec-04 16:08
cchere2-Dec-04 16:08 
GeneralProperties Tab Shows a Blank White Page Pin
kayhustle2-Dec-04 15:48
kayhustle2-Dec-04 15:48 
Generalsend maile in c# Pin
mehdidj2-Dec-04 15:45
mehdidj2-Dec-04 15:45 
Generalsend maile in c# Pin
mehdidj2-Dec-04 15:42
mehdidj2-Dec-04 15:42 
GeneralRe: send maile in c# Pin
Luis Alonso Ramos2-Dec-04 17:12
Luis Alonso Ramos2-Dec-04 17:12 
GeneralRe: send maile in c# Pin
Heath Stewart3-Dec-04 8:55
protectorHeath Stewart3-Dec-04 8:55 
GeneralRe: send maile in c# Pin
Luis Alonso Ramos3-Dec-04 12:35
Luis Alonso Ramos3-Dec-04 12:35 
GeneralRe: send maile in c# Pin
Heath Stewart3-Dec-04 21:49
protectorHeath Stewart3-Dec-04 21:49 
GeneralRe: send maile in c# Pin
Heath Stewart3-Dec-04 9:09
protectorHeath Stewart3-Dec-04 9:09 

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.