以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  求教简单的逻辑问题  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=94390)

--  作者:wzsunshao
--  发布时间:2016/3/6 9:03:26
--  求教简单的逻辑问题
cond5:=cond1 or cond2 or cond3 
公式1:  if  cond1 or cond2 or cond3 and cond4 then  
公式2:  if  (cond1 or cond2 or cond3) and cond4 then 
公式3:  if  cond5 and cond4 then 
请问以上3句逻辑结果在金字塔里是否一样

--  作者:wenarm
--  发布时间:2016/3/6 10:58:15
--  
and的优先级比or高,1和2 的逻辑上就有先后顺序。
公式1:  if  cond1 or cond2 or (cond3 and cond4) then  
公式2:  if  (cond1 or cond2 or cond3) and cond4 then 

--  作者:wzsunshao
--  发布时间:2016/3/6 11:21:30
--  
谢谢。运行效果是否如下
cond5:=cond1 or cond2 or cond3 ;
公式1:  if  cond1 or cond2 or cond3 and cond4 then =  if  cond1 or cond2 or (cond3 and cond4) then
公式2:  if  (cond1 or cond2 or cond3) and cond4 then =公式3:  if  cond5 and cond4 then 

--  作者:wenarm
--  发布时间:2016/3/6 16:55:40
--  
是的。理解正确