Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @civilvicky

    Thank you very much for using our plugin. The root is equivalent to power when the second operand is a fraction.

    For example, POW(3,3) = 27
    But POW(27,1/3) = 3

    So, you can use POW(x, 1/3)

    Best regards.

    Thread Starter civilvicky

    (@civilvicky)

    thank you.

    Thread Starter civilvicky

    (@civilvicky)

    It wont calculate negative values.

    Plugin Author codepeople

    (@codepeople)

    Hello @civilvicky

    Please, edit the equation as follows:

    Assuming the values are fieldname1 and fieldname2.

    
    (function(){
    var factor = IF(AND(fieldname2%2 == 1, fieldname1<0), -1, 1);
    return factor*POW(ABS(fieldname1), fieldname2);
    })()
    

    Best regards.

    Thread Starter civilvicky

    (@civilvicky)

    Its working, but the cube root of negative values is negative and the form is showing positive.

    Plugin Author codepeople

    (@codepeople)

    Hello @civilvicky

    If you have followed my instructions:

    (function(){
    var factor = IF(AND(fieldname2%2 == 1, fieldname1<0), -1, 1);
    return factor*POW(ABS(fieldname1), 1/fieldname2);
    })()

    The result should be negative. Please, look at the screenshot below:

    Best regards.

    Thread Starter civilvicky

    (@civilvicky)

    Plugin Author codepeople

    (@codepeople)

    Hello @civilvicky

    The problem is simple. You are doing the division in another field. In your form, fieldname2 is a calculated field with the equation 1/3. So, the value of the fieldname2 is 0.33333333333. This value makes fail the condition: fieldname2%2 == 1.

    The value of fieldname2 must be the integer number 3, and the equation:

    
    (function(){
    var factor = IF(AND(fieldname2%2 == 1, fieldname1<0), -1, 1);
    return factor*POW(ABS(fieldname1), 1/fieldname2);
    })()
    

    Best regards.

    Thread Starter civilvicky

    (@civilvicky)

    yeah its working fine now. thank you once again.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘cube root’ is closed to new replies.