当前位置:网站首页>常用运算符与运算符优先级
常用运算符与运算符优先级
2022-07-05 19:36:00 【叼个小孩尝尝鲜】
一、常用运算符
1、算数运算符
2、关系运算符
3、逻辑运算符
4、赋值运算符
5、条件运算符(唯一一个三元运算符)
二、算数运算符
基本的算数运算符
/ * % + -
三、关系运算符
测试两个值之间的关系,返回为true或false
<
<=
=
==
!=
===
!==
四、逻辑运算符
-&&(逻辑与):只有在操作数和第二个操作数都是ture时,其余为false
-!!(逻辑或):只有在第一个操作数和第二个操作数都是false,结果false,其余为true
-!(逻辑非):求反
五、赋值运算符
=、+=、-=、*=、/=、%=
六、条件运算符
三元运算符:–?--:–
第一个操作数为布尔值,为ture,计算第二个操作数,并返回计算结果,否则,计算第三个操作数,并返回计算结果
七、运算符优先级
| 运算符 | 操作 |
|---|---|
| ! | 逻辑非 |
| * 、/、 % | 乘、除、取余 |
| <、<=、>、>= | 小于、小于等于、大于、大于等于 |
| ==、!= | 判断等于、判断不等于 |
| ===、!= | 判断恒等于、判断恒不等于 |
| && | 逻辑与 |
| ll | 逻辑或 |
| ?: | 条件运算符 |
| =、+=、-=、*=、/=、%=等 | 赋值运算符 |
边栏推荐
- PHP利用ueditor实现上传图片添加水印
- UWB超宽带定位技术,实时厘米级高精度定位应用,超宽带传输技术
- Mariadb root用户及普通用户的密码 重置
- 打新债在哪里操作开户是更安全可靠的呢
- Inventory of the most complete low code / no code platforms in the whole network: Jiandao cloud, partner cloud, Mingdao cloud, Qingliu, xurong cloud, Jijian cloud, treelab, nailing · Yida, Tencent clo
- 618“低调”谢幕,百秋尚美如何携手品牌跨越“不确定时代”?
- Debezium系列之:IDEA集成词法和语法分析ANTLR,查看debezium支持的ddl、dml等语句
- Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
- C#应用程序界面开发基础——窗体控制(6)——菜单栏、工具栏和状态栏控件
- JAD的安装、配置及集成IDEA
猜你喜欢

Reflection and imagination on the notation like tool

Webuploader file upload drag upload progress monitoring type control upload result monitoring control

How to convert word into PDF? Word to PDF simple way to share!

Bitcoinwin (BCW)受邀参加Hanoi Traders Fair 2022

Decision tree and random forest

Postman core function analysis - parameterization and test report

Bitcoinwin (BCW) was invited to attend Hanoi traders fair 2022

【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法

IBM has laid off 40 + year-old employees in a large area. Mastering these ten search skills will improve your work efficiency ten times
Django使用mysqlclient服务连接并写入数据库的操作过程
随机推荐
建议收藏,我的腾讯Android面试经历分享
Information / data
The city chain technology Digital Innovation Strategy Summit was successfully held
Apprentissage du projet MMO I: préchauffage
Fuzor 2020軟件安裝包下載及安裝教程
【AI 框架基础技术】自动求导机制 (Autograd)
【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
HAC集群修改管理员用户密码
How to apply smart contracts more wisely in 2022?
安信证券在网上开户安全吗?
MySQL中字段类型为longtext的值导出后显示二进制串方式
Common - Hero Minesweeper
MMO project learning 1: preheating
Which securities company is better and which platform is safer for mobile account opening
Is it safe for Guohai Securities to open an account online?
PG基础篇--逻辑结构管理(用户及权限管理)
What are general items
【obs】libobs-winrt :CreateDispatcherQueueController
The problem of returning the longtext field in MySQL and its solution
What is the function of okcc call center