Field Calculator Raising a Field To a Power

4324
3
08-19-2010 10:36 AM
ZacharyMetz
New Contributor
I'm trying to raise the value of a field to a power.  How do I go about doing this?  What is the prelogic VBA script?
I notice the first 800 values where calculated correctly before error running VBA code pops up.  using the code below

36.89*([THICKNESS]^-0.3883)  Where am I going wrong?

*Update* The formula does not work when the value of Thickness = 0  causing the user interrupt error
0 Kudos
3 Replies
WilliamClark
New Contributor II
If thickness is allowed to = 0 then you end up with 0 raised to a negative power which is an undefined number.  You may have to set some rules/parameters to disallow thickness = 0.
0 Kudos
ZacharyMetz
New Contributor
If thickness is allowed to = 0 then you end up with 0 raised to a negative power which is an undefined number.  You may have to set some rules/parameters to disallow thickness = 0.


What would be the correct pre-logic VB Script parameters to exclude 0?
0 Kudos
RichardRupp
New Contributor II
Could you first select the features with [Thickness] > 0, and then run your algorithm on the selected set?
0 Kudos