For three digit exponents Fortran drops the 'E' in the output

落花浮王杯 提交于 2019-11-30 09:21:00

Try a format specification of ES11.2E3. That allows three positions (always) for the exponent.

There is a strong flavour of "fixed column width" to Fortran formatted input and output. Without the exponent field width specification, the "default" width is two. If the exponent part requires one more position than that, then the column normally occupied by the E is borrowed to at least permit output to continue without loss of information. If the exponent output requires two more than the default, then you'll see stars.

Note that if your other program was written in Fortran, then it would understand these strange real numbers with the missing E.

An edit descriptor such as G0.3 provides a partial workaround to this oddity, but you are not guaranteed scientific format.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!