Article View: alt.os.linux.mandrake
Article #518Re: Problems with float variables in C
From: Robert O'Dowd
Date: Thu, 06 Sep 2001 18:57
Date: Thu, 06 Sep 2001 18:57
21 lines
2461 bytes
2461 bytes
Rishabh Gupta wrote: > > Hi all, > I've been getting really strange results in my program when I use very > small float values. For example, I check for 0.0 in case of division by zero > errors but I still get the error. I also get other strange results > like -0.0000...... (although I'm guessing that its just not displaying all > the digits) > My system is > Pentium II 500 Mhz, 128MB > Linux Mandrake 8.0 > I have checked my program repeatedly and I can't find anything wrong with it > (its not even very complicated). Could the problem be a bug in the compiler > (GCC) or is it just supposed to do this? > At a guess, I'd say you're dividing a large value by a small value, and getting overflow. -- comp.lang.c.moderated - moderation address: clcm@plethora.net
Technical Details
Message-ID:
<clcm-20010906-0002@plethora.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!gemini.plethora.net.POSTED!not-for-mailReferences:
<clcm-20010905-0003@plethora.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,898a7d80327816b3 X-Google-Attributes: gid11318c,public X-Google-Thread: f8a83,898a7d80327816b3 X-Google-Attributes: gidf8a83,public X-Google-Thread: f65d0,898a7d80327816b3 X-Google-Attributes: gidf65d0,public X-Google-Thread: 108717,898a7d80327816b3 X-Google-Attributes: gid108717,public X-Google-Thread: 100850,77ebfbc06b0f9856 X-Google-Attributes: gid100850,public X-Google-ArrivalTime: 2001-09-06 11:57:55 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!gemini.plethora.net.POSTED!not-for-mail X-Old-trace: fang.dsto.defence.gov.au 999746933 2854 131.185.21.135 (6 Sep 2001 03:28:53 GMT) Subject: Re: Problems with float variables in C Approved: clc@plethora.net Content-Transfer-encoding: 7bit References: <clcm-20010905-0003@plethora.net> From: "Robert O'Dowd" <nospam@nonexistant.com> Organization: Defence Science and Technology Organisation X-Accept-language: en,pdf Return-Path: <news@fang.dsto.defence.gov.au> Content-Type: text/plain; charset=us-ascii X-Old-complaints-to: postmaster@dsto.defence.gov.au Mime-Version: 1.0 Newsgroups: alt.os.linux.mandrake,comp.lang.c.moderated,comp.programming,gnu.gcc,gnu.gcc.help Message-ID: <clcm-20010906-0002@plethora.net> X-Mailer: Mozilla 4.75 [en] (WinNT; U) Originator: clcm@plethora.net (Comp Lang C'Moderated) Date: 06 Sep 2001 18:57:54 GMT Lines: 21 NNTP-Posting-Host: 13bceb92.news.plethora.net X-Trace: 999802674 gemini.plethora.net 322 clcm@205.166.146.1 X-Complaints-To: abuse@plethora.net