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

C#

 
GeneralRe: This is sad Pin
RB@Emphasys15-Apr-03 7:50
RB@Emphasys15-Apr-03 7:50 
QuestionCType in C#? Pin
monrobot1315-Apr-03 7:25
monrobot1315-Apr-03 7:25 
AnswerRe: CType in C#? Pin
RB@Emphasys15-Apr-03 7:46
RB@Emphasys15-Apr-03 7:46 
AnswerRe: CType in C#? Pin
Martin Cook15-Apr-03 7:51
professionalMartin Cook15-Apr-03 7:51 
AnswerRe: CType in C#? Pin
Andres Manggini15-Apr-03 8:42
Andres Manggini15-Apr-03 8:42 
AnswerRe: CType in C#? Pin
Atul Kale16-Apr-03 1:11
Atul Kale16-Apr-03 1:11 
AnswerRe: CType in C#? Pin
monrobot1316-Apr-03 4:15
monrobot1316-Apr-03 4:15 
GeneralRe: CType in C#? Pin
Atul Kale16-Apr-03 5:51
Atul Kale16-Apr-03 5:51 
I was just wondering, the solution to ur problem is so Basic, in fact u must understand here, that u did not phrase ur question properly! U were just asking for ways to Convert the data.

Its a simple logic that while doing such operations, U never store the intermediate results in variables.


int num1 = 6, num2 = 10, num3 = 5, result;
here if u want,
(num1 / num2) * num3 which yields (6/10) * 5 = 0.6 * 5

Then boss, you should not store num1/num2 in an int variable. That is ur problem.


Do the Direct calculation,

result = (num1 / num2) * num3;


or,

use an intermediate double or float variable it u still wanna store the division.

double div = num1/ num2;

result = div * num3;


Sometimes one should just concenrate on the basics first and not just jump into complexities.



Atul Kale
MCSD, MCT
Sr. Software Engineer
XcelVision Technologies Ltd.
GeneralToolbox like C# Pin
tuan_tomy15-Apr-03 6:40
tuan_tomy15-Apr-03 6:40 
GeneralRe: Toolbox like C# Pin
perlmunger16-Apr-03 6:24
perlmunger16-Apr-03 6:24 
GeneralRedefining an Array with a charecter Pin
Ioncycle15-Apr-03 6:36
Ioncycle15-Apr-03 6:36 
GeneralAccessing Web Service through HTTP Proxy Pin
Atul Kale15-Apr-03 6:21
Atul Kale15-Apr-03 6:21 
GeneralRe: Accessing Web Service through HTTP Proxy Pin
Natty Gur15-Apr-03 18:16
Natty Gur15-Apr-03 18:16 
GeneralRe: Accessing Web Service through HTTP Proxy Pin
Atul Kale15-Apr-03 23:00
Atul Kale15-Apr-03 23:00 
GeneralIDisposable Pin
S O S15-Apr-03 5:45
S O S15-Apr-03 5:45 
GeneralRe: IDisposable Pin
Chris Austin15-Apr-03 6:18
Chris Austin15-Apr-03 6:18 
GeneralRe: IDisposable Pin
Andres Manggini15-Apr-03 6:20
Andres Manggini15-Apr-03 6:20 
GeneralTime Zone Pin
Mazdak15-Apr-03 4:16
Mazdak15-Apr-03 4:16 
GeneralRe: Time Zone Pin
Not Active15-Apr-03 5:07
mentorNot Active15-Apr-03 5:07 
GeneralRe: Time Zone Pin
Chris Austin15-Apr-03 5:09
Chris Austin15-Apr-03 5:09 
QuestionCorrect way to abort a Suspended thread? Pin
Christian Merritt15-Apr-03 3:24
Christian Merritt15-Apr-03 3:24 
AnswerRe: Correct way to abort a Suspended thread? Pin
Daniel Turini15-Apr-03 3:47
Daniel Turini15-Apr-03 3:47 
GeneralRe: Correct way to abort a Suspended thread? Pin
Christian Merritt15-Apr-03 3:54
Christian Merritt15-Apr-03 3:54 
AnswerRe: Correct way to abort a Suspended thread? Pin
Martin Cook15-Apr-03 8:26
professionalMartin Cook15-Apr-03 8:26 
GeneralRe: Correct way to abort a Suspended thread? Pin
Christian Merritt15-Apr-03 15:00
Christian Merritt15-Apr-03 15:00 

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.