Announcement

Collapse
No announcement yet.

How can you raise a number to a power?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can you raise a number to a power?

    Hi,

    How can I raise a number to a power?
    I have not found such a formula and

    a = b ** c;

    does not work.

  • #2
    Hi there,
    there is no such formula. You can try to use the While loop for this https://docs.espocrm.com/administration/formula/#while. Something like this:
    Code:
    $i = 2;
    while(
        $i <= c,
        b = b * b;
        $i = $i + 1;
    );
    a = b;
    Note, I didn't test this formula.

    Or you can try to add your custom formula for such purposes https://docs.espocrm.com/development...on-in-formula/.
    Last edited by Maximus; 09-16-2020, 07:01 AM.

    Comment


    • #3
      if the exponent is known ahead of time I would just express the power as multiplications

      Comment

      Working...
      X