简体   繁体   English

逻辑类型的无法分类的语句错误-Fortran

[英]Unclassifiable statement error of Logical Type - Fortran

program test
logical :: check
check = 2 < 3 < 5
print *, check
end program test

When trying to compile, it will give this error: 尝试编译时,会出现此错误:

Error(s): source_file.f:5:0: 错误:source_file.f:5:0:

check = 2 < 3 < 5 1 Error: Unclassifiable statement at (1) check = 2 <3 <5 1错误:(1)处无法分类的语句

where is the problem? 问题出在哪儿?

you can test it online here: https://rextester.com/l/fortran_online_compiler 您可以在此处在线进行测试: https//rextester.com/l/fortran_online_compiler

如果要检查2小于3,3小于5,则确实需要两次比较和一个布尔运算符

check = (2 < 3) .and. (3 < 5)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM