Discussions
»
Product and Service Development
»
Error Messages
»
What is a Divide by Zero error and what can I do about it?
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
A divide-by-zero error will occur whenever there is a denominator in the formula that could end up having a value of zero (even if there is no chance it will ever happen), such as this sample
formula: Close/(High-Low)
In this formula, if High-Low equates to zero (because the High and Low are equal), then a divide-by-zero error occurs.
To avoid divide-by-zero errors, the division that is giving the problem has to be identified and then rewritten to trap the zero, for instance, using the same sample formula above, we could do this:
Z:=If(H-L=0,.00001,H-L);
Close/(z);
Thus, when the zero would normally occur we substitute a value very near zero, .00001, to avoid the error. This does introduce a minimal, probably non-significant, error into the calculation, but it is often worth it.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
What does the number stand for directly following the divide by zero error?
It is the number of times that the calculation ran into the zero value.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/7/2005(UTC) Posts: 602
|
What does the number stand for directly following the divide by zero error?
It is the number of times that the calculation ran into the zero value.
Believe it is their error#, I get it also and when I switch charts the same # comes up.
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Error Messages
»
What is a Divide by Zero error and what can I do about it?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.