By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,908 Members | 2,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,908 IT Pros & Developers. It's quick & easy.

[Math Sqrt] Timing Problem ???

P: n/a
Hello,

I have got a very strange problem with the calcualtion of the the square
root (Math.Sqrt()).

I calculate in a loop a lot of of diameters

maxDiameter = Math.Sqrt(maxCrossSection * 4.00 / Math.PI);
minDiameter = Math.Sqrt(minCrossSection * 4.00 / Math.PI);
In my Visual Studio .NET development environment I get in the Debug and
the Release version the right results. If install my application and
test
the same functionallity the results are different to the results out of
my development environment.
How can that be ??

I' m doing further tests on this behaviour and implement for testing an
MessageBox after the calculation of the diameters, now I get in the
debug
version, the release version and in my installed version the correct
results.

Is there a timing problem for the Math.Sqrt() function ???

At the moment I' making a Thread.Sleep(0) after the calculation of the
diameters and everything is working fine
Best regards
Reiner
Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi!

Most probably your variables are not properly initialized.
Maybe you assumed zero somewhere and when you debug
it is zero at that location in the memory, but its not there
when you are running the app.
--
Atmapuri

"Reiner Apke" <R.****@gmx.de> wrote in message
news:3F***************@gmx.de...
Hello,

I have got a very strange problem with the calcualtion of the the square
root (Math.Sqrt()).

I calculate in a loop a lot of of diameters

maxDiameter = Math.Sqrt(maxCrossSection * 4.00 / Math.PI);
minDiameter = Math.Sqrt(minCrossSection * 4.00 / Math.PI);
In my Visual Studio .NET development environment I get in the Debug and
the Release version the right results. If install my application and
test
the same functionallity the results are different to the results out of
my development environment.
How can that be ??

I' m doing further tests on this behaviour and implement for testing an
MessageBox after the calculation of the diameters, now I get in the
debug
version, the release version and in my installed version the correct
results.

Is there a timing problem for the Math.Sqrt() function ???

At the moment I' making a Thread.Sleep(0) after the calculation of the
diameters and everything is working fine
Best regards
Reiner

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.