473,769 Members | 6,126 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(maxCr ossSection * 4.00 / Math.PI);
minDiameter = Math.Sqrt(minCr ossSection * 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 1868
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.d e> 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(maxCr ossSection * 4.00 / Math.PI);
minDiameter = Math.Sqrt(minCr ossSection * 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
5144
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 0.90000000000000013
17
3628
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 deep. In that case you need much more ram than a PC has to store functions calculated in loops so that you do not have to recalculate every time you cycle through the nest of loops. Using a HD for storage to extend ram is much too slow for many...
7
2474
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
22089
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 to 'pow'" error. Here is the relevant portion of my code. Your help would be appreciated. Thanks! * Genetic Algorithm module
3
2421
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
22055
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 error Name error : name 'sqrt' is not defined Same thing with sin(x) . I'm unable to find "math" , "sqrt" , or "sin" anywhere in lib , Libs or include directories . The Tutorial does not clear this up . Please help. Thanks Dave ...
5
1894
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 wondering was is there anything like this in Visual Basic or C#? Or even a DLL? I've got VS2008 and I really don't want to code the CORREL function by hand if I can just pass off 2 or more array's to a function that already exists.
5
13546
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 problems using arithmetic, but when I try to upgrade the programs using math libraries nothing seems to work. I downloaded a 2002 tutorial from Zelle "An Introduction to Computer Science" where he uses a "import math" statement to calculate a square...
13
10540
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 interested in what is going on behind the scenes and if there is some aspect of decimals that keep them from being used in this calculation. Thanks! Ethan Ethan Strauss Ph.D.
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.