This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
g++/gcc : Floating point issue
- From: abuzer dot salik at tcs dot com
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 26 Jul 2006 20:22:35 +0530
- Subject: g++/gcc : Floating point issue
- Sensitivity:
Hi,
I have an application which uses double values a lot. If I try to put say
401.74 in a double variable it is getting stored as 401.74000000000001
which creates problem in the calculations down the line. ( I am checking
these values using gdb debugger).
So, I am wondering if there is a way by which I can store the correct
values (i.e. 401.74) in the double.
We are using g++ compiler on Linux box.
Do we need to look for another compiler/hardware or current setup can
handle this?
Any suggestion/solution is highly appreciated.
Regards,
Abuzer Salik
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you