当前位置:网站首页>常用运算符与运算符优先级
常用运算符与运算符优先级
2022-07-05 19:36:00 【叼个小孩尝尝鲜】
一、常用运算符
1、算数运算符
2、关系运算符
3、逻辑运算符
4、赋值运算符
5、条件运算符(唯一一个三元运算符)
二、算数运算符
基本的算数运算符
/ * % + -
三、关系运算符
测试两个值之间的关系,返回为true或false
<
<=
=
==
!=
===
!==
四、逻辑运算符
-&&(逻辑与):只有在操作数和第二个操作数都是ture时,其余为false
-!!(逻辑或):只有在第一个操作数和第二个操作数都是false,结果false,其余为true
-!(逻辑非):求反
五、赋值运算符
=、+=、-=、*=、/=、%=
六、条件运算符
三元运算符:–?--:–
第一个操作数为布尔值,为ture,计算第二个操作数,并返回计算结果,否则,计算第三个操作数,并返回计算结果
七、运算符优先级
运算符 | 操作 |
---|---|
! | 逻辑非 |
* 、/、 % | 乘、除、取余 |
<、<=、>、>= | 小于、小于等于、大于、大于等于 |
==、!= | 判断等于、判断不等于 |
===、!= | 判断恒等于、判断恒不等于 |
&& | 逻辑与 |
ll | 逻辑或 |
?: | 条件运算符 |
=、+=、-=、*=、/=、%=等 | 赋值运算符 |
边栏推荐
- Apprentissage du projet MMO I: préchauffage
- Ten years at sea: old and new relay, dark horse rising
- That's awesome. It's enough to read this article
- UWB超宽带定位技术,实时厘米级高精度定位应用,超宽带传输技术
- Reinforcement learning - learning notes 4 | actor critical
- What are the reliable domestic low code development platforms?
- Decision tree and random forest
- C application interface development foundation - form control (5) - grouping control
- Mysql如何对json数据进行查询及修改
- JMeter 常用的几种断言方法,你会了吗?
猜你喜欢
How to apply smart contracts more wisely in 2022?
Hiengine: comparable to the local cloud native memory database engine
Android面试,android音视频开发
S7-200SMART利用V90 MODBUS通信控制库控制V90伺服的具体方法和步骤
【AI 框架基础技术】自动求导机制 (Autograd)
MMO项目学习一:预热
众昂矿业:2022年全球萤石行业市场供给现状分析
Notion 类生产力工具如何选择?Notion 、FlowUs 、Wolai 对比评测
The problem of returning the longtext field in MySQL and its solution
数据库 逻辑处理功能
随机推荐
全网最全的低代码/无代码平台盘点:简道云、伙伴云、明道云、轻流、速融云、集简云、Treelab、钉钉·宜搭、腾讯云·微搭、智能云·爱速搭、百数云
The relationship between temperature measurement and imaging accuracy of ifd-x micro infrared imager (module)
JAD的安装、配置及集成IDEA
Shell编程基础(第8篇:分支语句-case in)
The city chain technology Digital Innovation Strategy Summit was successfully held
PHP利用ueditor实现上传图片添加水印
Common interview questions in Android, 2022 golden nine silver ten Android factory interview questions hit
Django uses mysqlclient service to connect and write to the database
What does software testing do? What are the requirements for learning?
JAD installation, configuration and integration idea
C#应用程序界面开发基础——窗体控制(6)——菜单栏、工具栏和状态栏控件
The problem of returning the longtext field in MySQL and its solution
【无标题】
Decision tree and random forest
MMO项目学习一:预热
Pandora IOT development board learning (HAL Library) - Experiment 8 timer interrupt experiment (learning notes)
【obs】libobs-winrt :CreateDispatcherQueueController
JS solution force deduction daily question (12) - 556 Next larger element III (2022-7-3)
Summer Challenge database Xueba notes, quick review of exams / interviews~
Go语言 | 01 WSL+VSCode环境搭建避坑指南