Question

How to write 9.2903e-6 in php?

I have to convert sq-feet to hectares, so I have to write the conversion code.

Where 1 sq-meter = 9.2903e-6

I have to call a function in which I have to write a conversion code.

So, how to write a exponential value in php?

Was it helpful?

Solution

You should use pow function in php

Example:

<?php

var_dump(pow(2, 8)); // int(256)
echo pow(-1, 20); // 1
echo pow(0, 0); // 1

echo pow(-1, 5.5); // PHP >4.0.6  NAN
echo pow(-1, 5.5); // PHP <=4.0.6 1.#IND
?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top