Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否将实数分配给以 I 开头的变量转换为整数?
real vx; vx = 2.59808 ix = vx
是 ix == 2?
据我所知,类型将自动转换。
您可以通过指定来关闭这种容易出错的行为
IMPLICIT NONE
“隐式无”语句强制程序员声明所有变量。否则,类型将只是隐式的,并且以整数开头的变量i将是整数类型。
i
据我所知,您需要将实数转换为整数。
但我不确定,如果你的语言允许。