function scientific_notation ($value, $condensed
{
$e = 0;
while$value>=10 || $value<1)
{
if$value<=1)
{
$value *= 10;
$e--;
}
else
{
if$value>=10)
{
$value /= 10;
$e++;
}
}
}
if$condensed
return $value . "E" . $e
return $value . " x 10<sup>" . $e . "</sup>"
}
eXorithm – Execute Algorithm: View / Run Algorithm scientific_notation
