1 Reply Latest reply on Jul 14, 2010 2:18 PM by JeffBinTN

    Arithmetic over/underflow

    JeffBinTN

      On a form used in our hospitals for pre-admitting patients I'm trying to calculate BMI from height and weight.  I've put the formula in the script editor and it correctly calculates BMI, but when the form is first opened the following error message appears:

       

      Script failed (language is formcalc; context is xfa[0].form[0].F[0].#subform[1].BMI[0]) script=(Weight*703)/Height*Height)

      Error: arithmetic over/underflow.

       

      I suspect this is because the denominator (Height*Height) is zero before a value has been entered into Height.  Is this correct, and regardless whether it is or not, how can I avoid this error message?  The users are nurses and they tend to unwind when they encounter technical error messages.

        • 1. Re: Arithmetic over/underflow
          JeffBinTN Level 1

          Found the answer myself.  It was a problem with a zero denominator.  By using an if/then/endif you can control when it's trying to run the calculation.

           

          The original formula was (weight*703)/(height*height).

           

          The solution was:

           

          if(height>0)then(weight*703)*(height*height)endif

           

          That prevents it from trying to run the calculation before a value has been entered in 'height'.