• R/O
  • HTTP
  • SSH
  • HTTPS

Molby: コミット

Molecular Modeling Software


コミットメタ情報

リビジョン610210450aec7eea9ee86f6b45004826c25e0945 (tree)
日時2016-09-09 09:48:46
作者toshinagata1964 <toshinagata1964@a2be...>
コミッターtoshinagata1964

ログメッセージ

Creating cube file failed when very small electron density (<1e-100) appeared. Fixed.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@606 a2be9bc6-48de-4e38-9406-05402d4bc13c

変更サマリ

差分

--- a/MolLib/Molecule.c
+++ b/MolLib/Molecule.c
@@ -11658,8 +11658,15 @@ MoleculeOutputCube(Molecule *mp, Int index, const char *fname, const char *comme
1165811658 /* On Windows, the "%e" format writes the exponent in 3 digits, but
1165911659 this is not standard. So we avoid using %e */
1166011660 Double d = cp->dp[n++];
11661- int exponent = (int)floor(log10(fabs(d)));
11662- Double base = d * pow(10, -1.0 * exponent);
11661+ int exponent;
11662+ Double base;
11663+ if (d >= -1.0e-90 && d <= 1.0e-90) {
11664+ exponent = 0;
11665+ base = 0.0;
11666+ } else {
11667+ exponent = (int)floor(log10(fabs(d)));
11668+ base = d * pow(10, -1.0 * exponent);
11669+ }
1166311670 fprintf(fp, " %8.5fe%+03d", base, exponent);
1166411671 /* fprintf(fp, " %12.5e", d); */
1166511672 if (k == cp->nz - 1 || k % 6 == 5)
旧リポジトリブラウザで表示