473,508 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[Math Sqrt] Timing Problem ???

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
1 1850
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

89
5019
by: Radioactive Man | last post by:
In python 2.3 (IDLE 1.0.3) running under windows 95, I get the following types of errors whenever I do simple arithmetic: 1st example: >>> 12.10 + 8.30 20.399999999999999 >>> 1.1 - 0.2...
17
3589
by: cwdjrxyz | last post by:
Javascript has a very small math function list. However there is no reason that this list can not be extended greatly. Speed is not an issue, unless you nest complicated calculations several levels...
7
2458
by: herrcho | last post by:
i am learning C with 'a book on c' by kelley/pohl and got stuck in chapter 3 .. here is the code. #include <math.h> #include <stdio.h> main() { double x; while(1)
33
22027
by: Darius Fatakia | last post by:
Hi, I seem to be having trouble with some of my math functions (pow, sqrt, acos). They're the only ones I use in my code and they prevent the program from compiling. I get a "undefined reference...
3
2403
by: LeTubs | last post by:
Hi I'm having a bit of problem trying to compile a program..... which uses math.h #include <stdio.h> #include <stdlib.h> #include <math.h> double sxy, sxx, syyy;
4
22033
by: pdlemper | last post by:
Have carefully installed Python 2.5.1 under XP in dir E:\python25 . ran set path = %path% ; E:\python25 Python interactive mode works fine for simple arithmetic . Then tried >> import math Get...
5
1882
by: Nondisclosure007 | last post by:
Hello. If this is the wrong group for this, please let me know. I'll post it somewhere else. I've been doing data imports into MS Excel (ver 2007) and using the CORREL function. What I was...
5
13517
by: aguirre.adolfo | last post by:
Hi, I am a very newbie who would very much appreciate some hints. Python 2.52. on Windows XP for now. Soon on Ubuntu 8 I am teaching myself Python following free tutorials. I can solve...
13
10459
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
Hi, Why does Math.Sqrt() only accept a double as a parameter? I would think it would be just as happy with a decimal (or int, or float, or ....). I can easily convert back and forth, but I am...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7385
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.