Problems with integrate debugger and floating point numbers

Pascal Francq pfrancq at ulb.ac.be
Mon Sep 10 07:24:15 BST 2001


Hi,
I have a problem concerning the integrate debugger, when I try to watch 
floating point numbers, the value of the variable is not exactly the one 
excepted. Try this little program, and look and the values of d1 and d2.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
	char tmp[50];
	char tmp2[50];
	double d1,d2;

	strcpy(tmp,"30.2");
	strcpy(tmp2,"30.6");
	d1=atof(tmp);    // d1=30.19999999999
	d2=atof(tmp2);  // d2=30.60000000001
	return EXIT_SUCCESS;
}

I am using Mandrake 8.0 with gcc 2.96-061, glibc 2.2.4-2 and KDevelop 2.2-2.
Has someone the same problems?
I have a bug in a program manipulating floating point numbers, so it's 
difficult to debug when not exactly the same value are shown.
Thanks in advance.
-- 


Ir Pascal Francq
Researcher
Université Libre de Bruxelles
CAD/CAM Department
Avenue F.D. Roosevelt, 50
CP 165/14
B-1050 Brussels
BELGIUM
Tel. +32-2-650 47 65
Fax +32-2-650 47 24
ICQ: 91206668

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list