Click here to Skip to main content
15,914,452 members
Home / Discussions / C#
   

C#

 
GeneralRe: Bitwise and, or, xor with doubles. Pin
PIEBALDconsult20-Feb-08 14:58
mvePIEBALDconsult20-Feb-08 14:58 
GeneralRe: Bitwise and, or, xor with doubles. Pin
PhilDanger20-Feb-08 14:12
PhilDanger20-Feb-08 14:12 
GeneralRe: Bitwise and, or, xor with doubles. Pin
Christian Graus20-Feb-08 20:10
protectorChristian Graus20-Feb-08 20:10 
GeneralRe: Bitwise and, or, xor with doubles. Pin
Insincere Dave20-Feb-08 14:07
Insincere Dave20-Feb-08 14:07 
GeneralRe: Bitwise and, or, xor with doubles. Pin
Luc Pattyn20-Feb-08 15:59
sitebuilderLuc Pattyn20-Feb-08 15:59 
GeneralHelp with DirectShow.Net Pin
etherny20-Feb-08 12:36
etherny20-Feb-08 12:36 
GeneralRe: Help with DirectShow.Net Pin
Christian Graus20-Feb-08 13:17
protectorChristian Graus20-Feb-08 13:17 
GeneralI need help with errors. Pin
Alex50120-Feb-08 9:48
Alex50120-Feb-08 9:48 
I dont know how to fix my error. Could someone help me out.
I use C# expression.

namespace ConsoleApplication1
{
private void rand_seed()

{

int seed = (int)(time(0));

RandomNumbers.Seed(seed);

}

private double get_RandomNum(double x, double y)

{

return x + (y - x) * RandomNumbers.NextNumber() * (1.0 / RAND_MAX);

}



private static int Main()

{

rand_seed();

double x_cor = 0;

double y_cor = 0;

double x_sum = 0;

double y_sum = 0;

double x_y_total = 0;

int num_darts = 0;

int num_hits = 0;

int num_misses = 0;

double pi_approx = 0;

Console.Write(" Throw the dart: ");

num_darts = SimulateCin.ReadToWhiteSpace(true);

Console.Write("\n");

if (num_darts != 0)

{

for (int i = 0; i < num_darts; i++) // Start of for loop inside the while loop

{

x_cor =get_RandomNum(1.0, -1.0);

y_cor =get_RandomNum(-1.0, 1.0);

x_sum = (x_cor * x_cor);

y_sum = (y_cor * y_cor);

x_y_total = Math.Sqrt(x_sum + y_sum);

if (x_y_total <= 1)

{

num_hits++;

}

else

{

num_misses++;

}

}

} // end of if loop

pi_approx = (1.0 * num_hits /num_misses);

Console.Write(" The value is ");

Console.Write(pi_approx);

Console.Write("\n");

return 0;

}

}
GeneralRe: I need help with errors. Pin
DaveyM6920-Feb-08 9:55
professionalDaveyM6920-Feb-08 9:55 
GeneralRe: I need help with errors. Pin
Skippums20-Feb-08 11:16
Skippums20-Feb-08 11:16 
GeneralRe: I need help with errors. Pin
Christian Graus20-Feb-08 11:39
protectorChristian Graus20-Feb-08 11:39 
GeneralSerializing IEnumerable&lt;int&gt; interface Pin
Skippums20-Feb-08 9:11
Skippums20-Feb-08 9:11 
GeneralRe: Serializing IEnumerable&lt;int&gt; interface Pin
TheGreatAndPowerfulOz20-Feb-08 13:24
TheGreatAndPowerfulOz20-Feb-08 13:24 
GeneralRe: Serializing IEnumerable&lt;int&gt; interface Pin
Skippums21-Feb-08 6:04
Skippums21-Feb-08 6:04 
GeneralRe: Serializing IEnumerable&lt;int&gt; interface Pin
TheGreatAndPowerfulOz21-Feb-08 6:35
TheGreatAndPowerfulOz21-Feb-08 6:35 
Generalinsert text at particular column and row in listview Pin
Xmen Real 20-Feb-08 7:43
professional Xmen Real 20-Feb-08 7:43 
GeneralRe: insert text at particular column and row in listview Pin
DaveyM6920-Feb-08 9:03
professionalDaveyM6920-Feb-08 9:03 
GeneralRe: insert text at particular column and row in listview [modified] Pin
Xmen Real 20-Feb-08 13:38
professional Xmen Real 20-Feb-08 13:38 
GeneralDisplaying context sensitive help AND scrolling the help file to a topic Pin
kozu20-Feb-08 7:37
kozu20-Feb-08 7:37 
Generalget controls inside a form in a Multi form application Pin
Kariem Soudy20-Feb-08 6:45
Kariem Soudy20-Feb-08 6:45 
GeneralRe: get controls inside a form in a Multi form application Pin
DaveyM6920-Feb-08 7:21
professionalDaveyM6920-Feb-08 7:21 
GeneralRe: get controls inside a form in a Multi form application Pin
darkelv20-Feb-08 14:44
darkelv20-Feb-08 14:44 
GeneralRe: get controls inside a form in a Multi form application Pin
Kariem Soudy9-Mar-08 3:23
Kariem Soudy9-Mar-08 3:23 
QuestionHow to set a proxy for axWebbrowser? Pin
vedmack20-Feb-08 6:41
vedmack20-Feb-08 6:41 
AnswerRe: How to set a proxy for axWebbrowser? Pin
Dave Kreskowiak20-Feb-08 7:26
mveDave Kreskowiak20-Feb-08 7:26 

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.