[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom ["Basham, Richard R" <Richard.Basham@PSS.Boeing.com>] (fwd)
- To: rtl@rtlinux.org
- Subject: BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom ["Basham, Richard R" <Richard.Basham@PSS.Boeing.com>] (fwd)
- From: Der Herr Hofrat <der.herr@hofr.at>
- Date: Thu, 10 May 2001 06:50:39 +0200 (CEST)
>From owner-rtl Wed May 9 14:07:04 2001
Received: from blv-smtpout-01.boeing.com (blv-smtpout-01.boeing.com [192.161.36.5])
by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f49K73J25241
for <rtl@fsmlabs.com>; Wed, 9 May 2001 14:07:04 -0600
Received: from blv-av-02.boeing.com ([192.54.3.92])
by blv-smtpout-01.boeing.com (8.9.2/8.8.5-M2) with ESMTP id NAA17936
for <rtl@fsmlabs.com>; Wed, 9 May 2001 13:02:57 -0700 (PDT)
Received: from blv-hub-01.boeing.com (localhost [127.0.0.1])
by blv-av-02.boeing.com (8.9.3/8.9.2/MBS-AV-01) with ESMTP id NAA28839
for <rtl@fsmlabs.com>; Wed, 9 May 2001 13:02:55 -0700 (PDT)
Received: from xch-pssbh-03.nw.nos.boeing.com by blv-hub-01.boeing.com with ESMTP for rtl@fsmlabs.com; Wed, 9 May 2001 13:02:50 -0700
Received: by xch-pssbh-03.nw.nos.boeing.com with Internet Mail Service (5.5.2650.21)
id <K1TGVB1D>; Wed, 9 May 2001 13:02:49 -0700
Message-Id: <949ACC17102DD045AAB154CEB75A7EC402B10BA5@xch-nw-21.nw.nos.boeing.com>
From: "Basham, Richard R" <Richard.Basham@PSS.Boeing.com>
To: "'rtl@fsmlabs.com'" <rtl@fsmlabs.com>
Subject: RE: [rtl] Floating point question
Date: Wed, 9 May 2001 13:02:44 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain
Jonas,
I have seen problems like this before where the compiler does not promote variable types when you expect it. I suggest that you type cast all to float. Sometimes just putting the float first in line solves this as well.
Regards,
Rich
> ----------
> From: Jonas Persson[SMTP:jonas.persson@comsys.se]
> Reply To: rtl@fsmlabs.com
> Sent: Wednesday, May 09, 2001 9:33 AM
> To: RTLinux Mailing list
> Subject: [rtl] Floating point question
>
> 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
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
>