-2

I have a calculation in php like

$outpout = 1.056^(365/10)

But it not calculating in right manner

you can try it like $outpout = (3^3);

Please help me. Thanks in advance.

  • 3
    In PHP, `^` is an XOR [bitwise operator](http://php.net/manual/en/language.operators.bitwise.php), not an exponential operator – Mark Baker May 22 '15 at 13:07

1 Answers1

0

As of PHP 5.6.0 we have ** operator

If you need 3^3

You can do $x = 3 ** 3 ;

If you are using older version, use

$x = pow(3, 3) ;

In both cases $x will be 27

Source: PHP Documentation

viral
  • 3,724
  • 1
  • 18
  • 32