Click here to Skip to main content
15,893,487 members
Home / Discussions / C#
   

C#

 
QuestionC# Programmme of Vocabulary Learning (involving 6 correct wordpairs, separated by '\t') Pin
Ntoki17-May-07 18:35
Ntoki17-May-07 18:35 
AnswerRe: C# Programmme of Vocabulary Learning (involving 6 correct wordpairs, separated by '\t') Pin
mav.northwind17-May-07 19:32
mav.northwind17-May-07 19:32 
QuestionExecuting Javascript in ASPX Pin
darora317-May-07 18:17
darora317-May-07 18:17 
AnswerRe: Executing Javascript in ASPX Pin
Sathesh Sakthivel17-May-07 18:37
Sathesh Sakthivel17-May-07 18:37 
GeneralRe: Executing Javascript in ASPX Pin
darora317-May-07 23:22
darora317-May-07 23:22 
QuestionMultiple Instance Performance Counter not working Pin
jchilberto17-May-07 18:05
jchilberto17-May-07 18:05 
AnswerRe: Multiple Instance Performance Counter not working Pin
jchilberto20-May-07 11:03
jchilberto20-May-07 11:03 
QuestionHelp with declaring variables (int vs float ) Pin
crash89317-May-07 15:39
crash89317-May-07 15:39 
Hi all,

Ive been working on a program that does a few easy equations but i am running into problems when i run into larger numbers where the numbers start to crash out. in the source below can you think of aything that i could change to stop this from happening.


secondly some times i have to display some larger numbers but when i convert to string i get it in scientific notation 234230000e^12 type stuff

is there anyway to just display it straight numbers??


below is my source code





Random random = new Random();
float X1, X2, X3, Y1, Y2, Y3;
//STEP3 MAKE RANDOM PNT1
X1 = random.Next(2,10000);
Y1 = random.Next(2,10000);

//STEP2 MAKE PNT2 WITH CONSTANT ( FROM TEXT BOX)
X2 = Convert.ToInt64(textBox7.Text);
Y2 = 0;

X3 = 1;
Y3 = 1;

//STEP4 GET SLOPE FROM PNT1 AND PNT2
float slope = (Y2 - Y1) / (X2 - X1);
float t = random.Next(2,10000);

//STEP5 GET RANDOM POINT ALONG LINE MADE PNT1 AND PNT2
X3 = t + X2;
Y3 = t * slope + Y2;


//OUTPUT TO TEXTBOX
textBox5.Text = t.ToString();
textBox6.Text = slope.ToString();

textBox1.Text = X1.ToString();
textBox2.Text = Y1.ToString();

textBox9.Text = X3.ToString();
textBox8.Text = Y3.ToString();
AnswerRe: Help with declaring variables (int vs float ) Pin
Christian Graus17-May-07 15:42
protectorChristian Graus17-May-07 15:42 
AnswerRe: Help with declaring variables (int vs float ) Pin
Sathesh Sakthivel17-May-07 15:44
Sathesh Sakthivel17-May-07 15:44 
AnswerRe: Help with declaring variables (int vs float ) Pin
theney18-May-07 10:44
theney18-May-07 10:44 
QuestionEquation Editor Pin
hungvuong_hdu17-May-07 14:47
hungvuong_hdu17-May-07 14:47 
AnswerRe: Equation Editor Pin
Christian Graus17-May-07 15:53
protectorChristian Graus17-May-07 15:53 
GeneralRe: Equation Editor Pin
hungvuong_hdu17-May-07 16:26
hungvuong_hdu17-May-07 16:26 
QuestionHow To Force Webservice To Use Integrated Windows Authentication Pin
classNoob17-May-07 14:13
classNoob17-May-07 14:13 
AnswerRe: How To Force Webservice To Use Integrated Windows Authentication Pin
Sathesh Sakthivel17-May-07 15:09
Sathesh Sakthivel17-May-07 15:09 
GeneralRe: How To Force Webservice To Use Integrated Windows Authentication Pin
classNoob18-May-07 8:10
classNoob18-May-07 8:10 
Questionadding dropdownlist to a datagridview Pin
balanjingot17-May-07 14:10
balanjingot17-May-07 14:10 
AnswerRe: adding dropdownlist to a datagridview Pin
Sathesh Sakthivel17-May-07 15:05
Sathesh Sakthivel17-May-07 15:05 
Questionseek into .wmv file while recording? Pin
cjtaylor17-May-07 12:48
cjtaylor17-May-07 12:48 
AnswerRe: seek into .wmv file while recording? Pin
Christian Graus17-May-07 13:13
protectorChristian Graus17-May-07 13:13 
GeneralRe: seek into .wmv file while recording? Pin
Luc Pattyn17-May-07 13:35
sitebuilderLuc Pattyn17-May-07 13:35 
GeneralRe: seek into .wmv file while recording? Pin
Christian Graus17-May-07 13:51
protectorChristian Graus17-May-07 13:51 
GeneralRe: seek into .wmv file while recording? Pin
Luc Pattyn17-May-07 14:23
sitebuilderLuc Pattyn17-May-07 14:23 
GeneralRe: seek into .wmv file while recording? Pin
cjtaylor18-May-07 11:51
cjtaylor18-May-07 11:51 

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.