PureBytes Links
Trading Reference Links
|
I guess I have to reply to this since there seems to be a new
misunderstanding.
At 9:28 PM +0200 7/23/01, pierre.orphelin wrote:
>TS may display what it wants after digit 8 because it does not use
>exponents, but the digits displayed after 8th digit is garbage, as
>announced by the theory.
Absolutely true. I'm glad you finally get it. As we have been saying,
a single precision float has a resolution of about 7 decimal digits.
As quoted in my message of 7/21/01:
>>At 10:02 AM -0600 7/2/01, Gary Fritz wrote (Code List):
>>
>> >As background: single-precision floats have a 24-bit mantissa. That
>> >is, they use 24 bits to represent the base of the number, and 8 bits
>> >for the exponent. 24 bits can represent a signed value in the range
>> >+/-8388608 or so, or not quite 7 digits of precision. You can
>> >calculate the decimal (base 10) digits available with the formula
>> >
>> > (MatissaBits - 1) * log10(2)
>> >
>> >MantissaBits is 24, and we must subtract one bit for the sign of the
>> >mantissa. That formula says there are 6.92 decimal digits available.
>A float being a 32 bits BINARY number, you cannot expect a decimal
>number with more than 10 digits ( 2^32), even if the magnitude of the
>number is more than this ( magnitude being carried by the exponent
>part that is coded in the 32 bit binary number, that in fact reduces
>the precision mantissa part ).
A float actually has a 24 bit mantissa and an 8 bit exponent.
Precision is actually 2^24 = about 7 digits as explained above, but
you are "close enough for Government work..."
>So the example provided by Kent is dead wrong becase the
>precision should have been carried by the 22th digit, what could even
>not exist by adding two doubles !)
That is not what he said. He said the opposite. Perhaps there is some
problem in the translation.
>My 9999999 limit in the average_WC test was beyond this limit to
>avoid to have a part of the higher number carried by the exponent at
>the detriment of the mantissa.
This and your comment above indicate that you think that TradeStation
uses integer arithmetic up to +-2^31 and floating point (24 bit
mantissa and 8 bit exponent) for bigger numbers. Perhaps you are
correct but I seriously doubt it. (Most other programming languages
allow the programmer to specify this explicitly but EasyLanguage does
not.) I understood that all numbers were handled as floats. It would
be very time consuming to check all arithmetic operations at run time
and do any required integer-to-float conversions. Does anybody else
know for sure?
If all numbers are floats, as I believe, your 9999999 limit is much
smaller than the actual limit. My tests show that the limit would be
at least:
1,234,567,948,140,544.
>From your other examples, it appears that the 7 digits is the limit
>of TS precision, what is correct with what I say
And consistent with what Kent, Gary, and I have been saying... The
errors in the digits beyond 7 digits are normal and exactly what we
would expect from single-precision floats.
>and I have nothing more to add...
I am also tired of the subject but feel compelled to correct your
incorrect information, particularly when you ridicule others based
upon your incorrect understanding of the facts.
Bob Fulks
|