range of int type integers
The range of int is -2147483648~2147483647.
The calculation method is as follows:
The range of 32-bit int type variables in the computer, where the int type is a signed integer.
Positive numbers are expressed as original codes in the computer, and the highest bit is the sign bit: The original code of
1 is the original code of 0000 0000 0000 0000 0000 0000 0000 0001
2147483647 The code is 0111 1111 1111 1111 1111 1111 1111 1111
So the largest positive integer is 2147483647
Negative numbers are represented as complement codes in the computer, and the highest bit is the sign bit:
-1:
The original code is 1000 0000 0000 0000 0000 0000 0000 0001, the inverse code of
is 1111 1111 1111 1111 1111 1111 1111 1110, the complement code of
is 1111 1111 1111 1111 1111 1111 1111 1111
-2147483647: The original code of
is 1111 1111 1111 1111 1111 1111 1111 1111, the reverse code of
is 1000 0000 0000 000 0 0000 0000 0000 0000 ,
The complement is 1000 0000 0000 0000 0000 0000 0000 0001
So the smallest negative number is -2147483647? Wrong, no.
In binary, there are two table methods for 0.
The original code of 0 is 0000 0000 0000 0000 0000 0000 0000 0000, the original code of
-0 is 1000 0000 0000 0000 0000 0000 0000 0000,
because 0 is only One is needed, so use -0 as the smallest number -2147483648. The complement code of
-2147483648 is expressed as 1000 0000 0000 0000 0000 0000 0000 0000. There is no original code in 32 bits.
Note that this complement is not the real complement. The real complement is 1 1000 0000 0000 0000 0000 0000 0000 0000, which is an overflow.
So the signed 32-bit int type integer is -2147483648~2147483647
Programming can directly call the function to find the range:
#include <limits.h> #include<stdio.h> int max = INT_MAX;//最大数 int min = INT_MIN;//最小数 int main(){ printf("max = %d\nmin = %d\n", max, min); return 0; }
The above is the detailed content of range of int type integers. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

When encountering the blue screen error VIDEO_TDR_FAILURE(nvlddmkm.sys), priority should be given to troubleshooting graphics card driver or hardware problems. 1. Update or rollback the graphics card driver: automatically search and update through the device manager, manually install or roll back to the old stable driver using NVIDIA official website tools; 2. Adjust the TDR mechanism: Modify the TdrDelay value in the registry to extend the system waiting time; 3. Check the graphics card hardware status: monitor the temperature, power supply, interface connection and memory module; 4. Check system interference factors: run sfc/scannow to repair system files, uninstall conflicting software, and try safe mode startup to confirm the root cause of the problem. In most cases, the driver problem is first handled. If it occurs repeatedly, it needs to be further deepened.

When the "Thecloudfileproviderisnotrunning" error appears, the cloud file service should be restarted first. The method is to open the service manager (services.msc), find CloudFileProvider or related services (such as OneDrive), and right-click to select Restart; if the service is not listed, you may need to reinstall or repair the cloud storage application, such as uninstalling and reinstalling through the settings menu; at the same time, make sure that the system and application are both the latest versions, go to Windows Update and in-app to check for updates; you also need to confirm that the cloud service is allowed to run in the background, enter the privacy settings to enable the background permissions of the corresponding application; finally, if the problem is still not solved, you can try to clear the cloud file cache.

The device manager displays exclamation marks usually caused by hardware connection problems or driver abnormalities. The solutions are as follows: 1. Check the device connection and power supply, ensure that it is plugged and unplugged and uses live HUB or replace the interface; 2. Update or roll back the driver, and obtain the latest driver through the device manager or official website; 3. Clean up the residual information of the old device, uninstall the hidden device and re-identify it; 4. Carefully modify the registry, delete the exception after backup; if it still cannot be solved, try reinstalling the system.

Software keyboard loggers capture keyboard input through the background running and are often used to steal sensitive information. It may be installed through malicious downloads, phishing emails, disguised updates, etc., and hide processes or modify attributes to evade detection. To detect the keyboard logger, you can 1. Check whether there are unfamiliar programs in the startup item; 2. Observe abnormal behaviors such as cursor movement and typing delay; 3. Use task manager or ProcessExplorer to find suspicious processes; 4. Use Wireshark or firewall tools to monitor abnormal network traffic; 5. Run anti-malware such as Malwarebytes and HitmanPro to scan and clear it. In terms of prevention, we should do: 1. Do not download software from unknown sources; 2. Do not click on suspicious links or attachments from emails; 3. Guarantee

Rapid shaking of the washing machine is usually caused by imbalance, including uneven loading of clothing, unmounted machine, wear of suspension components or unremoved transport bolts. 1. Uneven distribution of clothes is the most common reason. Thick clothes should be placed evenly and overloaded; 2. The machine is not level and will cause shaking. The floor flatness and casters should be checked. Stable plates should be installed on the carpet; 3. Wearing of the suspension components may cause vibration and abnormal noise from the air machine, and the maintenance costs are high; 4. The transport bolts are not removed, which will also cause violent shaking. The bolts at the rear should be checked and removed. It is recommended to prioritize simple problems such as load balancing, horizontal status and transport bolts, and then consider mechanical failures.

The method to resolve the error "This device has been disabled because the device firmware does not provide it with the required resources. (Code 29)" is as follows: 1. Update or reinstall the device driver, go to Device Manager to uninstall the device and restart the computer, or manually download the latest driver installation; 2. Check the BIOS/UEFI settings to ensure that the relevant devices are enabled and configured correctly, such as turning on the "LegacyUSB Support" or "4G or above decoding" option; 3. Advanced users can delete the BrokenPciResources value through the registry editor to resolve resource conflicts, but they need to back up the registry before operation; 4. Insert the device into other PCI/PCIe slots or test it on another computer to troubleshoot hardware problems. This can usually be effectively repaired through the above steps

To delete a Facebook account, you can follow the following steps: First, enter the settings page, find "AccountOwnershipandControl" in "YourFacebook Information", then select "Deactivation andDeletion", and confirm in the options that click "DeleteAccount" to delete it completely. Before deletion, you need to pay attention to: backup important data such as chat history and photos in advance; manually notify contacts you want to say goodbye; unbind third-party applications logged in through Facebook. After submitting the deletion application, the system will complete the processing within 30 days, and you can regret it and cancel the deletion during this period. Once officially deleted, all funds

First run the power troubleshooter, then use the administrator command prompt to execute the powercfg-restoredefaultschemes command to reset the power scheme, then update or reinstall the ACPI driver, check the Group Policy settings (Pro/Enterprise Edition only), run sfc/scannow to repair the system files, and determine whether it is a user profile problem by creating a new user account. In most cases, the power options will return to normal.