The following should do the basics of what you want. It would need to be fixed to handle negative values, or to handle negative exponents properly, but it should give you a starting point:

$exp_k = int(ln($a)/ln(10));

$mant_k = $a/10**$exp_a;

You are currently using guest access (Log in)