472,992 Members | 3,218 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,992 software developers and data experts.

"Start" and "Start Without Debugging" give different results

A couple of days ago there was a thread "Returning the machine epsilon".

The responses in that thread suggested using Double.Epsilon or
Single.Epsilon. Since both these seem to return zero I thought I would try
to compute these epsilons myself. Using the following program fragment:

===================================
private void button4_Click(object sender, System.EventArgs e) {
float a;
float f= 1.0f;
float one= 1.0f;
do {
f/= 2.0f;
a= one+f;
} while (a>one);
Say("f="+FNum(f));
} // button4_Click

public static string FNum(float x){
return x.ToString("n20");
} // FNum

public static void Say(string x) {
MessageBox.Show(x);
} // Say
===================================

If I run this using Debug|Start I get:

f=0.00000005960464000000

which is probably the correct answer.

If I run this using Debug|Start Without Debugging I get:

f=0.00000000000000011102

which is probably Double.Epsilon.

Tiny changes to the above program fragment change this behavior.

I am using Microsoft Development Environment 2003, Version 7.1.3088 and
Microsoft .NET Framework 1.1, Version 1.1.4322 .

Any ideas?

--
Clive Tooth
http://www.clivetooth.dk
Nov 15 '05 #1
0 1855

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hal Vaughan | last post by:
I know that I need to launch a VBS file on Windows this way: Win9x: Runtime.getRuntime().exec("start script.vbs"); WinNT: Runtime.getRuntime().exec("cmd /c start script.vbs"); I'm doing...
0
by: Alont | last post by:
so how I can test asp code as I test VB project? the function such as "start","step into",etc. all can't use when I edit asp file, InterDev can't "Start" asp file? the IE give me such a simple...
4
by: choihead | last post by:
Hi All, How can i excuete a bat file by c#? I used System.Diagnostics.Process.Start("../stage.bat"); but it cannot find the file, is this the correct method to call the bat file? thx...
2
by: Andrew | last post by:
VS.net Win 2k3 I'm getting the following error when attempting to debug. I'm not debugging remotely, just a local project. "Unable to start debugging. Cannot find port. Check the remote...
0
by: LBeveridge | last post by:
Hi, This morning I installed Visual Studio 2005 side-by-side 2003. The first problem I've noted is that projects in 2003 that have "Start External Program" set don't do that. I'm creating a...
1
by: Nick Ward | last post by:
Hey, I'm writing an app using C# visual studio express edition. When i run it in debug mode it runs fine and works perfectly, but when i run it without debugging (or from explorer) it crashes and...
3
by: AnalogKid17 | last post by:
I have the following line of code in my start/login page: document.getElementById("txtLogin").focus(); When I run the website app through F5 (Debug, Start Debugging) it works fine (ie, focus...
0
by: active | last post by:
Sometimes when I After I click "Start Debugging" I get a "File not Found" Exception. Could not load file or assembly 'FormTesting, Version=1.0.2646.36738, Culture=neutral, PublicKeyToken=null'...
0
by: Curious | last post by:
Hi, I try to set up debugging environment in Visual Studio 2003. So I open the Properties of the project and select "Debugging". I'll need to at first enter "C:\Program Files\AutoTrade\MyTools...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.