句号在 Fortran 的这一行中起什么作用?
我不确定这是什么版本的 Fortran,但该行是:
Term = F*F - 4.*E*G
我知道它将 F 乘以 F,然后减去一些值,但我不知道4之后的时期在那里做什么。
I am not sure what version of Fortran this is, but the line is:
Term = F*F - 4.*E*G
I know that it multiplies F by F and then subtracts something, but I don't know what the period after the 4 is doing there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我将根据我见过的所有其他编程语言进行大胆的猜测,并说它使常量“4”成为 Real 类型,而不是 Integer 类型。 换句话说,它确保表达式中的类型全部匹配。 “4.0”是等价的; 无论谁写了这段代码,那天都感觉格外简洁。
I'm going to venture a guess based on every other programming language I've ever seen, and say that it's making the constant "4" of type Real, rather than Integer. In other words, it's making sure the types in the expression all match up. "4.0" would be equivalent; whoever wrote this code was just feeling extra concise that day.
它使其成为实数而不是整数。
It makes it a real number instead of an integer.
如果您不熟悉 Fortran,那么“REAL”数字在类 C 语言中就是所谓的“浮点数”。
但默认情况下,只有 Fortran 程序员才能说上帝是真实的。
If you're new to Fortran, a "REAL" number is what is called in C-like languages a "float".
But only Fortran programmers can say the GOD is REAL, by default.