[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom ["Jonas Persson" <jonas.persson@comsys.se>] (fwd)



>From owner-rtl Wed May  9 10:40:17 2001
Received: from ideon.se (iris.ideon.se [193.45.79.9])
	by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f49GeFJ23696
	for <rtl@fsmlabs.com>; Wed, 9 May 2001 10:40:16 -0600
Received: by ideon.se from localhost
    (router,SLMail V2.6); Wed, 09 May 2001 18:35:35 +0200
Received: by ideon.se from zeta
    (194.237.138.68::mail daemon; unverified,SLMail V2.6); Wed, 09 May 2001 18:35:35 +0200
From: "Jonas Persson" <jonas.persson@comsys.se>
To: "RTLinux Mailing list" <rtl@fsmlabs.com>
Subject: Floating point question
Date: Wed, 9 May 2001 18:33:53 +0200
Message-ID: <GBEBJEDLOFFHLCHJLHDLEEIJCDAA.jonas.persson@comsys.se>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-15"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
In-Reply-To: 
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by hq.fsmlabs.com id f49GeHJ23697

Hi all!

So, now I have gotten to the dreaded floating point issue. However, I think my problem is a little rare... the problem is that the FPU simply does not give correct answers. Consider the following code excerpt:

	  m0 = ramp*chi_off*ang_lim/ my_2_pi;

Given the following parameters, 
  ramp = 1,
  chi_off = 0.299,
  ang_lim = 198,
  my_2_pi = 6.28,

the statement above returns

  m0 = -2147483648 !!!

Interesting, isn't it? m0 is an int, the rest are floats. If I run the program without debugging and trace data through an RT-fifo, I get lots of results like the above example. However if I debug the program, and wait for a few seconds, sometimes different results are returned. 

Can anyone guess at possible causes for this happening? Have anyone else experienced the same behaviour?

Apart from this, my system is working fine, I have no crashes, hangups or other bad behaviour. 

My configuration is:
Pentium III 866 processor, tyan SMP motherboard, kernel 2.2.18-rtl. Base distribution is SuSE 7.0, and exchanged the stock installed debugger for gdb 5.0. I am using the stock gcc 2.95.2 19991024 that comes with SuSE.

BTW, I solved my previous problem by NOT doing rtf_flush() from a rt-thread... :-)

Yours very confusedly,
Jonas Persson

______________________________________________________________________
 Jonas Persson                    E-mail: jonas.persson@comsys.se
 Project Manager, M.Sc C.Sc&E     http://www.comsys.se/
 Comsys AB                        Phone: +46-(0)46-286 3500
 Forskningsbyn IDEON              Fax: +46-(0)46-286 3505
 S-223 70 Lund, Sweden