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

RE: No clue



PureBytes Links

Trading Reference Links

Stack overflow or floating point overflow?

Floating point overflow can be caused when a large numerator is divided by a VERY small denominator, which does not have to be zero. The common test for zero (in the example below) ...

     if DENOM <> 0 then value1 = NUMER/DENOM

is not as good as the following test ....

     if absvalue(DENOM) > 0.0000001 then value1 = NUMER/DENOM

OTOH, stack overflow can occur when the number of embedded function calls exceeds the stack's ability to keep track of it all.  This can occur when a function is being called recursively too many times, or too many functions are calling too many others.

Either way, even a CRAY computer can get both types of overflow if the user's program is poorly written. 

- Mark Jurik



----------
From: 	phil
Sent: 	Tuesday, April 16, 2002 11:28 AM
To: 	omega-list@xxxxxxxxxx
Subject: 	No clue

Hi List,

TS products are a piece of .........  Today I got two different floating
point errors that knocked me out both times. The first was a stack overflow
error and the second was a stack under error. What gives?? Any suggestion on
how to prevent this in the future.

Omega ought to have to pay for any losses suffered while in a trade and then
not being able to execute an order due to "downtime".

Phil