当前位置:网站首页>1.5 - 逻辑运算
1.5 - 逻辑运算
2022-06-30 06:12:00 【是李黏黏鸭】
一、逻辑运算

- 或:一个为真则为真;
- 与:一个为假则为假;
- 异或:都为真则为假,都为假也是假;一真一假则为真;
- 同或:都为真则为真,都为假则为真;一真一假则为假;
- 非:本身是真即是假;本身是假则为真;
二、辅助理解

- 0表示假,1表示真;
注意:每种逻辑运算都有很多种表示符号,分别适用于不用的环境;例如||适用在代码中,其他的有的可以用在代数运算中;
三:考点:逻辑运算的

- 由题可知,00、11是数值符号的有效表现形式;也就是当两个数值的符号位都是00,或都是11时,他们的逻辑运算结果为真(0);
- 01、10是数值符号的无效表现形式;也就是当两个数值的符号位都是01,或者都是10时,他们的逻辑运算结果为假(1);
- 所以由此推断,需要进行 异或 逻辑运算,才能满足题中要求的两个符号相同的数相加,运算结果产生溢出,也就是假(1);
注意:
在做逻辑运算的题时,遇到不正常的情况,如上题中的溢出,那么他的结果就是假,也就是1;
边栏推荐
- 1.9 - Cache
- Thread safe solutions, communication between threads (classic examples of producers and consumers)
- Rhcsa day 3
- Gazebo model modification
- [database] transaction
- IP TCP UDP network encryption suite format
- Common NPM install errors
- Es6数组
- MySQL index
- Loading class `com. mysql. jdbc. Driver‘. This is deprecated. The new driver class is `com. mysql. cj. jdb
猜你喜欢

Gazebo model modification
A complete performance test process

01. 正则表达式概述

Loading class `com. mysql. jdbc. Driver‘. This is deprecated. The new driver class is `com. mysql. cj. jdb

Idea add database

【微信小程序:单选、多选样式,背景色,圆角】

Mysql database learning notes - foreign keys, table connections, subqueries, and indexes for MySQL multi table queries

File operation io-part1

Swoole process model diagram

gazebo/set_ model_ State topic driving UAV model through posture
随机推荐
[regular expression series] greedy and non greedy patterns
One sentence introduction to Trojan horse
My experience in functional testing for so many years
Beauty of Refactoring: when multithreaded batch processing task lifts the beam - Universal scaffold
谁不想要一个自己的博客网站呢 - 搭建博客网站wordpress
ES6 extended operator (...)
requests. The difference between session () sending requests and using requests to send requests directly
Static routing job
Network basics
数据读写:Unity中基于C#脚本实现数据读写功能
Common NPM install errors
IP TCP UDP network encryption suite format
Why does the verification code not refresh when clicked
ES6数组遍历与ES5数组遍历
Prototype and prototype chain in JS
Improve simulation speed during ROS and Px4 joint simulation
Go pack and unpack
As function memo
Centos8 install redis
Ten years' miscellaneous thoughts