最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What does "!" mean in pseudo-code? I know "!" stands for factorial but I can&am

programmeradmin11浏览0评论

What does ! mean in pseudo-code? I know ! stands for factorial but I can't translate it .

ex:

get operation

if (operation!= ’B’ OR operation != ’D’ OR operation!= ’W’) then
    print "Invalid Operation"

What does it mean?

What does ! mean in pseudo-code? I know ! stands for factorial but I can't translate it .

ex:

get operation

if (operation!= ’B’ OR operation != ’D’ OR operation!= ’W’) then
    print "Invalid Operation"

What does it mean?

Share Improve this question edited Aug 16, 2019 at 23:03 S.S. Anne 15.6k8 gold badges41 silver badges81 bronze badges asked Mar 16, 2010 at 22:56 DinaDina 5751 gold badge5 silver badges6 bronze badges 1
  • Interesting (stackoverflow.com/questions/2304809/…) :-) – Buhake Sindi Commented Mar 16, 2010 at 23:24
Add a comment  | 

3 Answers 3

Reset to default 6

!= means not equal and ! generally means not or negation.

It means "not". So your example code

if (operation!= ’B’ OR operation != ’D’ OR operation!= ’W’)

can be read as

"If operation does not equal 'B' or operation does not equal 'D' or operation does not equal 'W'"

In general,

!   means   not
|| means logical or
&& means logical and

Example:

!false == true  ( == means equality )

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论