str$ は1000000.1 や 0.00001 で予想外のことが起こるから要注意。 あと s<=1e-308 でlog がエラーになります。