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

RE: Precision Errors



PureBytes Links

Trading Reference Links



> -----Message d'origine-----
> De : Bob Fulks [mailto:bfulks@xxxxxxxxxxxx]
> Envoye : dimanche 22 juillet 2001 20:03
>.
>
> Pierre:
>
> The way I read Kent's post he is exactly correct so I conclude that
> he understands how floating point works.
>

Are you kidding?
The number of signifiant digits in FP is no more than 10 ( depends on
various sources), and  what I read was an example waiting for  a 22 digits
precision by ading two Float, means a perfect misunderstanding!

Here is an example from the web

http://www.google.com/search?q=cache:Wx1TpZPpalo:www.developpez.com/sgbd/ODI
BDataType.htm+Float+precision+nombre&hl=fr&lr=lang_fr


DECIMAL(precision,scale)
 variable
 precision = 1 a 15 (digits) et scale 1 a 15 (decimals incluses)
 Exemple : DECIMAL(10,3) autorisera un nombre de type ppppppp.sss

DOUBLE PRECISION
 64 bits
 1.7x10-308 a 1.7x10308
 notation scientifique, 15 digits de precision

FLOAT
 32 bits
 3.4x10-38 a 3.4x1038
 simple precision, 7 digits

NUMERIC(precision,scale)
 variable
 precision = 1 a 15 (digits) et scale 1 a 15 (decimals incluses)
 Idem DECIMAL

INTEGER
 32 bits
 -2.147.483.648 a 2.147.483.647
 entier long signe

SMALLINT
 16 bits
 -32 768 a 32 767
 entier court signe



> The way I read your post of 7/19/01 suggesting the following code:
>
> >if sum> = 9999999- 2*price
> >{ please check the acceptable precision limit according to your own TS
> >precision belief}
> >then begin
>
> makes me think that you do not understand how floating point works.

The 9999999  7 digitslimit has been set beyond the FP limit to avoid the TS
problem  overflow where the precision may be lost after a given high limit.
As anyone disagree on what is the true TS variable precision, I have set
this " according to your own belief" in my comment.

Please conduct further testing if yoy want to determine what is the highest
number in EL not affected by cumulative overflow, I have other things to do.
The only reproach that yoiu can do is thta I gave the example  for a
positive accumulation ( whre in this case you may use  the absvalue.


>
> So, based upon these post, I would think you are the one who needs to
> do some reading...

Bad thinking , dear Bob.

Sincerely,

Pierre Orphelin
www.sirtrade.com
TradeStation Technologies representative in France