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

RE: Language problems causes bugs not to be understood as the bugs they are



PureBytes Links

Trading Reference Links



> -----Message d'origine-----
> De : Bengtsson, Mats [mailto:mats.bengtsson@xxxxxxxx]
> Envoyé : mardi 17 juillet 2001 01:15
> À : pierre.orphelin@xxxxxxxxxxxxxx; Eskimo Omega List
> Objet : RE: Language problems causes bugs not to be understood as the
> bugs they are
>
>
> Ok, so you tell me that it should never plot a zero. Interesting.
> This based
> on simple mathematics. Even more interesting.

I do not want to spend the night with this.
Here is your code with comments ( and it produces an horizontal line here)


> > > > > var: plusdm(0);
> > > > > var: minusdm(0);
> > > > > var: plusdm1(0);
> > > > > var: minusdm1(0);
> > > > > 		If 10.387 - 10.280 < 0 Then
> > > > > 			PlusDM = 0

So PlusDm will never be set to 0 (10.387 >10.280) 10.387 - 10.280 produces a
positive number

> > > > > 		Else

Yes, else...

> > > > > 			PlusDM = 10.387 - 10.280;

PlusDM will always (Else) produce : 10.387 - 10.280 =0.107, means an
horizontal line.

> > > > > 		If 10.280 - 10.173 < 0 Then
> > > > > 			MinusDM = 0

Minus DM will never be set  to 0

> > > > > 		Else
> > > > > 			MinusDM = 10.280 - 10.173;

But set to 0.107

> > > > > 		If MinusDM >= PlusDM Then
> > > > > 			PlusDM = 0;

Yes, it shoud be set to  0 if the rounding errors that is always the same
over bars produced a stricly 0 value.
But even with double precision, this error wil remains and the result will
be  0 if the epsilon difference is below 0, 0.107 in the other case.
What you see here is computer approximation on basic operation, and as your
opration remains the same over bars, the same epsilon value is produced.
This will not affect in any case the precision of the calculus more than the
epsilon effect ( single or double precision)

Good night.

PO

> > > > > 		plot1 (plusdm);
> > > >

>