470,814 Members | 763 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,814 developers. It's quick & easy.

"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);
} // button4_Click

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

public static void Say(string x) {
} // Say

If I run this using Debug|Start I get:


which is probably the correct answer.

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


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
Nov 15 '05 #1
0 1718

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Hal Vaughan | last post: by
1 post views Thread by Nick Ward | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.