当前位置:网站首页>Arithmetic expression
Arithmetic expression
2022-04-23 17:41:00 【KK should continue to work hard】
Arithmetic expression
Arithmetic operator
- +: Both operators are numbers to add , The rest are hyphens
-
-
- /
- %
Implicit type conversion
If an operand involved in a mathematical operation is not of numeric type , This operand is automatically converted to numeric type ( The essence is to call... Internally Number Function converts the corresponding value to a numeric type )
of IEEE754
terms of settlement : When performing decimal operations , To call the number toFixed Method , Keep the specified number of decimal places
Negative numbers have no open root , So for NaN
Relationship expression
Relational operator : The result of relational operator operation is Boolean value
- <
-
=
- <=
- ==
- !==
- ===
- !=
Equality and congruence
- equal : Two equal signs do not compare the type of value , It compares the values after implicit conversion
- Congruence : The three equal signs compare not only the same value but also the same type
- null and undefined use == Compare ( Involving implicit cast ,ES5 The specification States )
If x by null,y by undefined, The result is true; If x by null,y by undefined, The result is true - null and undefined use === When comparing, the result is false Because of different types
typeof null //object
typeof undefined //undefined
NaN==NaN //false
NaN===NaN //false
How to judge whether it is NaN:isNaN()
Logical expression
Logical operators
- !
- &&
- ||
Short circuit calculation
a&&b Operation :a really , The value of the expression is b;a false , The value of the expression is a
a||b Operation :a really , The value of the expression is a;a false , The value of the expression is b
Logical operation sequence : Not ---- And ---- or
Assignment expression
Assignment operator
- =
- +=
- -=
- *=
- /=
- %=
- ++
- –
Synthetic expression
The order of operations : Non operation ---- Mathematical operations ---- Relationship between operation ---- Logical operations
The range of variables represents
// 5<=a<=12
if(a>=5&&a<=12){
}
版权声明
本文为[KK should continue to work hard]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230551363466.html
边栏推荐
- SQL optimization for advanced learning of MySQL [insert, primary key, sort, group, page, count]
- Hcip fifth experiment
- Self use learning notes - connectingstring configuration
- Advantages and disadvantages of several note taking software
- The system cannot be started after AHCI is enabled
- HCIP第五次实验
- Halo 开源项目学习(二):实体类与数据表
- 剑指 Offer 22. 链表中倒数第k个节点-快慢指针
- Dry goods | how to extract thumbnails quickly?
- 1217_使用SCons生成目标文件
猜你喜欢
394. 字符串解码-辅助栈
Clickhouse table engine
[WPF binding 3] listview basic binding and data template binding
Qt error: /usr/bin/ld: cannot find -lGL: No such file or directory
470. 用 Rand7() 实现 Rand10()
双指针进阶--leetcode题目--盛最多水的容器
Use of five routing guards
How to change input into text
干货 | 快速抽取缩略图是怎么练成的?
常用SQL语句总结
随机推荐
Future 用法详解
双闭环直流调速系统matlab/simulink仿真
Use of five routing guards
Qt 修改UI没有生效
Understanding and small examples of unity3d object pool
Model problems of stock in and stock out and inventory system
练习:求偶数和、阈值分割和求差( list 对象的两个基础小题)
MySQL advanced index [classification, performance analysis, use, design principles]
matlab如何绘制已知公式的曲线图,Excel怎么绘制函数曲线图像?
圆环回原点问题-字节跳动高频题
[C] thoroughly understand the deep copy
MySQL进阶学习之SQL优化【插入,主键,排序,分组,分页,计数】
Solution of Navicat connecting Oracle library is not loaded
386. 字典序排数(中等)-迭代-全排列
Oninput one function to control multiple oninputs (take the contents of this input box as parameters) [very practical, very practical]
SQL optimization for advanced learning of MySQL [insert, primary key, sort, group, page, count]
102. 二叉树的层序遍历
01-初识sketch-sketch优势
Open futures, open an account, cloud security or trust the software of futures companies?
[logical fallacy in life] Scarecrow fallacy and inability to refute are not proof