Domanda

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?

È stato utile?

Soluzione

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
?>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top