当前位置:网站首页>常用运算符与运算符优先级
常用运算符与运算符优先级
2022-07-05 19:36:00 【叼个小孩尝尝鲜】
一、常用运算符
1、算数运算符
2、关系运算符
3、逻辑运算符
4、赋值运算符
5、条件运算符(唯一一个三元运算符)
二、算数运算符
基本的算数运算符
/ * % + -
三、关系运算符
测试两个值之间的关系,返回为true或false
<
<=
=
==
!=
===
!==
四、逻辑运算符
-&&(逻辑与):只有在操作数和第二个操作数都是ture时,其余为false
-!!(逻辑或):只有在第一个操作数和第二个操作数都是false,结果false,其余为true
-!(逻辑非):求反
五、赋值运算符
=、+=、-=、*=、/=、%=
六、条件运算符
三元运算符:–?--:–
第一个操作数为布尔值,为ture,计算第二个操作数,并返回计算结果,否则,计算第三个操作数,并返回计算结果
七、运算符优先级
| 运算符 | 操作 |
|---|---|
| ! | 逻辑非 |
| * 、/、 % | 乘、除、取余 |
| <、<=、>、>= | 小于、小于等于、大于、大于等于 |
| ==、!= | 判断等于、判断不等于 |
| ===、!= | 判断恒等于、判断恒不等于 |
| && | 逻辑与 |
| ll | 逻辑或 |
| ?: | 条件运算符 |
| =、+=、-=、*=、/=、%=等 | 赋值运算符 |
边栏推荐
- MySQL中字段类型为longtext的值导出后显示二进制串方式
- ELK分布式日志分析系统部署(华为云)
- 测试外包公司怎么样?
- 14、用户、组和权限(14)
- Notion 类生产力工具如何选择?Notion 、FlowUs 、Wolai 对比评测
- Fundamentals of machine learning (III) -- KNN / naive Bayes / cross validation / grid search
- [OBS] qstring's UTF-8 Chinese conversion to blog printing UTF-8 char*
- Ultrasonic ranging based on FPGA
- Bitcoinwin (BCW)受邀参加Hanoi Traders Fair 2022
- 【obs】libobs-winrt :CreateDispatcherQueueController
猜你喜欢

Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application

UWB ultra wideband positioning technology, real-time centimeter level high-precision positioning application, ultra wideband transmission technology

Password reset of MariaDB root user and ordinary user

强化学习-学习笔记4 | Actor-Critic
The problem of returning the longtext field in MySQL and its solution

Do you know several assertion methods commonly used by JMeter?

How to apply smart contracts more wisely in 2022?

Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL

That's awesome. It's enough to read this article

使用easyexcel模板导出的两个坑(Map空数据列错乱和不支持嵌套对象)
随机推荐
Notion 类生产力工具如何选择?Notion 、FlowUs 、Wolai 对比评测
Recommended collection, my Tencent Android interview experience sharing
MMO project learning 1: preheating
Successful entry into Baidu, 35K monthly salary, 2022 Android development interview answer
Vagrant2.2.6 supports virtualbox6.1
Mariadb root用户及普通用户的密码 重置
What are general items
【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
软件测试工程师是做什么的?待遇前景怎么样?
测试的核心价值到底是什么?
Bitcoinwin (BCW) was invited to attend Hanoi traders fair 2022
Shell编程基础(第8篇:分支语句-case in)
Fuzor 2020软件安装包下载及安装教程
618“低调”谢幕,百秋尚美如何携手品牌跨越“不确定时代”?
【obs】libobs-winrt :CreateDispatcherQueueController
HAC集群修改管理员用户密码
IBM大面积辞退40岁+的员工,掌握这十个搜索技巧让你的工作效率至上提高十倍
太牛了,看这篇足矣了
Reflection and imagination on the notation like tool
Zhongang Mining: analysis of the current market supply situation of the global fluorite industry in 2022