public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] One question.
@ 2006-05-31  6:50 Zhao.Green
  2006-05-31  7:58 ` Michele Portolan
  0 siblings, 1 reply; 14+ messages in thread
From: Zhao.Green @ 2006-05-31  6:50 UTC (permalink / raw)
  To: pderocco, ecos-discuss

Dear Sir:
	Sure, if I try to less precision in output. The result can be round back to 0.1.
But if  the dnum1 = 0.00000000001 , dnum2 = dnum1.
Result = dnum1+dnum2 
The result is 0.00000000002
This amaze me.

When dnum1  = 0.00000000001, the register show this value is 9.9999999999999994e-12.



BR
Green



-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org [mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Paul D. DeRocco
Sent: Wednesday, May 31, 2006 2:29 PM
To: eCos Discuss
Subject: RE: [ECOS] One question.

> From: Zhao.Green@inventec-inc.com
>
> 	I use the ecos package , and I found the double type question Double 
> dnum1 = 1234567.1 Double dnum2 = 1234567 Double result = 0 ;
>
> Result = dnum1-dnum2 ;
>
> The result is 0.10000000009
>
> Anybody know how to solve this question?

0.1 can't be represented exactly in binary, so there's an inevitable roundoff error. Sometimes these errors are hidden by the implementation of the binary to decimal conversion used in printing out the answer, but sometimes not. I don't know if you're using printf in C, or << in C++, but you might try requesting less precision in the output, to see if that rounds the result back to 0.1.

--

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [ECOS] One question.
@ 2006-05-31  5:15 Zhao.Green
  2006-05-31  6:12 ` Fabian Scheler
  2006-05-31  6:28 ` Paul D. DeRocco
  0 siblings, 2 replies; 14+ messages in thread
From: Zhao.Green @ 2006-05-31  5:15 UTC (permalink / raw)
  To: ecos-discuss

Dear ALL:
	I use the ecos package , and I found the double type question
Double dnum1 = 1234567.1
Double dnum2 = 1234567
Double result = 0 ;

Result = dnum1-dnum2 ;

The result is 0.10000000009

Anybody know how to solve this question?

BR
Green

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [ECOS] One question..
@ 2004-06-25  8:09 anton yakovlev
  2004-06-25 11:28 ` Gary Thomas
       [not found] ` <40DBE222.8040603@codito.com>
  0 siblings, 2 replies; 14+ messages in thread
From: anton yakovlev @ 2004-06-25  8:09 UTC (permalink / raw)
  To: ecos-discuss

Hi, all!

I have a programm:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#include <stdio.h>
#include <cyg/kernel/kapi.h>

void first(cyg_addrword_t threadData) {

    (void) threadData;
    printf("the first thread\n");

}

static char stack_a[4096];
static cyg_thread thread_a;
static cyg_handle_t handle_a;

void cyg_user_start(void) {
   
    cyg_thread_create(10, first, 0, "first", stack_a, 4096, &handle_a, 
&thread_a);
    cyg_thread_resume(handle_a);

}
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
but when i try to executing it, i see only following:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
RedBoot> load -r -m y -b 0x205000
Raw file loaded 0x00205000-0x00210500
xyzModem - CRC mode, 363(SOH)/0(STX)/0(CAN) packets, 3 retries
RedBoot> go 0x205000

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
i.e. thread want not to start.. Why so?..

I have Falcom fx35xxlsi (based on NEC V850 processors family) platform 
with eCos 2.0.. I build eCos from the sources.. Maybe I have broken 
configuration?..


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-05-31 11:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-31  6:50 [ECOS] One question Zhao.Green
2006-05-31  7:58 ` Michele Portolan
2006-05-31 11:49   ` Edgar Grimberg
  -- strict thread matches above, loose matches on Subject: below --
2006-05-31  5:15 Zhao.Green
2006-05-31  6:12 ` Fabian Scheler
2006-05-31  6:28 ` Paul D. DeRocco
2004-06-25  8:09 anton yakovlev
2004-06-25 11:28 ` Gary Thomas
2004-06-26  8:59   ` anton yakovlev
2004-06-26 11:50     ` Gary Thomas
2004-06-26 12:26       ` anton yakovlev
2004-06-26 12:31         ` Gary Thomas
2004-06-26 15:40           ` anton yakovlev
     [not found] ` <40DBE222.8040603@codito.com>
2004-06-26  8:49   ` anton yakovlev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).